【问题标题】:position is not a valid member of Part?position 不是 Part 的有效成员?
【发布时间】:2020-05-05 22:28:45
【问题描述】:

我有下面的代码,它应该作为应对称为“巨石”(未锚定)的部分,并将其移动到所需位置,而是:“位置不是零件的有效成员”

while true do
    wait(2)
    local original = workspace.boulder
    -- Create the model copy
    local copy = original:Clone()
    -- Parent the copy to the same parent as the original
    copy.Parent = original.Parent
    -- Move the copy so it's not overlapping the original
    copy.position = CFrame.new(-84.76, 206.227, 143.094) -- where error happens
    Debris:AddItem(copy, 2)
end

【问题讨论】:

标签: exception lua position roblox


【解决方案1】:

您似乎遇到的问题是因为Position 应该有一个大写的 P。

修复:

while true do
wait(2)
local original = workspace.boulder
-- Create the model copy
local copy = original:Clone()
-- Parent the copy to the same parent as the original
copy.Parent = original.Parent
-- Move the copy so it's not overlapping the original
copy.Position = CFrame.new(-84.76, 206.227, 143.094) -- Position Capitalised correctly
Debris:AddItem(copy, 2)

结束

【讨论】:

  • 哎呀,没有意识到这已经在 cmets 中得到了回答,我将保留这个答案,以便让这个问题显示为已回答,并清楚地表明确实有一个答案
猜你喜欢
  • 2019-09-12
  • 2021-08-26
  • 2022-08-18
  • 2021-09-23
  • 2022-01-26
  • 1970-01-01
  • 1970-01-01
  • 2019-03-12
  • 2021-04-12
相关资源
最近更新 更多