Simple CFrame issues

How do I make example 1 be like example 2?

Example 1:

Example 2:

while script.Parent.chr.Value ~= nil do

script.Parent:SetPrimaryPartCFrame(workspace[script.Parent.chr.Value].HumanoidRootPart.CFrame * CFrame.new(0,0,-5))

wait()

end

you can add a CFrame.Angles() to control orientation like this:
basepart:SetPrimaryPartCFrame(position cframe * CFrame.Angles(0,0,0))
to add orientation you need to use math.rad() and the deegres you want to rotate.
i think its also possible to use the new pivot things but i haven’t took a look into it

How would I add that to my script? Because as of now it moves the part negative 5 studs from the player’s rootpart, I just want it to do that and rotate correctly.

script.Parent:SetPrimaryPartCFrame(workspace[script.Parent.chr.Value].HumanoidRootPart.CFrame * CFrame.new(0,0,-5) * CFrame.Angles(0,math.rad(90),0))

Thanks, it worked. I’ll get to know CFrame.Angles beter.

1 Like