Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Moving a player and changing its rotation?

i'm making a script where when i click on a bed, the player's torso position moves to a certain brick's position on the bed but i also want the player to have the same rotation as the brick but it wont work, the player is always facing the same direction.

here is the line

player.Character.Torso.CFrame = CFrame.new(Vector3.new(t.Position.x, t.Position.y, t.Position.z))CFrame.Angles(t.Rotation.x, t.Rotation.y, t.Rotation.z)

i tried a lot of methods to find the rotation but most of them were creating errors.

Also i make sure the player gets anchored when he moves to the position

1 answer

✓ Accepted answer

#What you can do Why are you doing all those steps? CFrame isn't a point in 3D space, it's a 3D point in space, rotation, and the direction it's looking according to the 3 axises. Instead of trying to break apart the CFrame of the object t, why not just set the Torso's CFrame to the part's? It'll automatically make the position, rotation, and facing direction the same.


#Final Product

player.Character.Torso.CFrame = t.CFrame


Hope it helps!

1 comment

0

well, thanks it did work in fact XD guess im just dumb!

This discussion is preserved as it was. New answers, comments, and votes are closed.