Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make 2 players face each other? (LookVector not Reversing)

Asked by
steelflix -12
3 years ago
player2.Character.LowerTorso.CFrame = player1.Character.LowerTorso.CFrame + player1.Character.LowerTorso.CFrame.LookVector * -5

I have this code to teleport player2 to player1 and it works, but player2 teleports facing the same direction as player1, I want them to face opposite directions so that they are facing each other but the lookvector won't reverse. How would I do this?

1 answer

Log in to vote
1
Answered by 3 years ago

Vector maths is a pain.

If you want to rotate a vector by 180 degrees (i.e pi radians) the easiest way would be to multiply by a CFrame.Angles in which one of the axes are math.rad(180) and the other two are zero.

Ad

Answer this question