我有下面的代码,它应该作为一个称为“巨石”(未固定)的零件,然后将其移动到所需位置,但是:“该位置不是零件的有效成员”
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
您似乎遇到的问题是因为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)
结束