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

How to make a character face in the direction of the camera?

I'm using BodyGyro to rotate the player's character. The code below makes it so that the character faces where the camera is positioned. I'm trying to get the opposite effect, but having difficulty. I vaguely remember reading a question about this on here a long time ago, but I can't remember or find it with Google.

gyro.CFrame = CFrame.new(root.Position, Vector3.new(camera.CFrame.X, root.Position.Y, camera.CFrame.Z))

1 comment

0

What do you mean the opposite effect?

1 answer

Oh I think I know what you mean, try this:

local pos = root.Position - Vector3.new(camera.CFrame.X, 0, camera.CFrame.Z)
gyro.CFrame = CFrame.new(root.Position, pos)

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