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

Rotation following player?

Asked by
Vezious 310 Moderation Voter
8 years ago

So, last year, When I knew nothing about scripting, I joined this game that taught you how to script. It had this big eye. It would look at you. What I mean is that. If you move, the eye rotates to look at you. How did they do that?

1
BodyGyros or mathematics. Have fun! minikitkat 687 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Well, I suppose you're trying to find the CFrame that allows one thing to "look" at another. This is easy.

CFrame.new(vector1, vector2)

vector1 is the object's position, and the vector2 is the position that the object (or vector1) will look at.

Ad

Answer this question