Hello why when I do :SetPrimaryPartCFrame, my object doesn’t move? even the primary part CFrame does’t move. What’s worse for me is that it works if I use on command bar but in game it doesn’t work.
Current script, very simple just for testing :
local flags = workspace["US Flag"]
local flag = flags.AnimatedFlag
flag:SetPrimaryPartCFrame(flag.PrimaryPart.CFrame + Vector3.new(0, 20 , 0))
local flags = workspace["US Flag"] --The Model?
local flag = flags.AnimatedFlag -- The Child?
flags:SetPrimaryPartCFrame(flags.PrimaryPart.CFrame + Vector3.new(0, 20 , 0))
If not the case, check if you have a Part Assigned as the PrimaryPart
SetPrimaryPartCFrame is deprecated and should not be used for new work. Instead you should use PivotTo to move the model, and GetPivot to get the current position of the model (The blue dot when you edit a model in Studio).
You can use + Vector3.new, rather than * CFrame.new, the only difference is that +Vector3, will not be in the 3d space of the cframe but rather will be in world space.