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

Rotate Character to Object?

Asked by 4 years ago

I'm trying to make a camera system, Its follows the same principle as the camera system from the legend of Zelda series. When you target an object, ie sign, NPC, Enemy the camera locks on them and the player can only walk around them. I have all that done. What I need help with is when the player runs around them they are running sideways. This is do to Humanoid.AutoRotate set to true. If the player runs left their character faces left, if they go right their character faces right. If I set Auto-Rotate to false then their character spins in circles because there is nothing making the character turn as they walk.

How would you make a player face an object? if you could just point me in the right direction that would be perfect.

In the code I have a loop for the camera to face the object I just don't know how to face the player.

1 answer

Log in to vote
0
Answered by 4 years ago

you can use CFrame.new(pos1,pos2) to get a cframe at pos1, facing pos2, hope this helps

0
Could you explain this a bit more? Babyseal1015 56 — 4y
Ad

Answer this question