hey,
I’m making a script that after the dummy has walked to a place, it will fix it’s rotation to watch the table.
I’ve tried searching a round a way to help me, but sadly found none.
Sadly the following part of the script doesn’t work as wanted.
I’ve tried putting the following values(0,90,180,270,360,20,35,210,178), but the dummy won’t rotate more than 90 degrees.
Only the values < 90 will rotate it to the right value, all the ones after 90 will just put it at 90°, not more.
The desired value would be 180 if it worked.
local originalCF = Clone:GetPrimaryPartCFrame()
Clone:SetPrimaryPartCFrame(CFrame.new(originalCF.Position,Vector3.new(180,0,0)))
As @SageToxigen said, there’s a difference between ObjectSpace and WorldSpace.
Here’s a link explaining it. Object and World Space | Documentation - Roblox Creator Hub
Also CFrames don’t recognize anything below and above 180 for Orientation. As you can tell by looking at objects in the workspace they are all -180 to 180 degrees.
It’s actually simple, just set the position to where you want the dummy to face to, like this:
local FacingDirection = Vector.new(0, 0, 0) -- The WorldSpace position you want the dummy to face to
local originalCF = Clone:GetPivot()
Clone:SetPivot(CFrame.new(originalCF.Position, FacingDirection))