I'm trying to rotate the player in the direction the Joystick is facing, it works however it's off 90°, meaning if you hold UP(?) the character looks LEFT. If you hold RIGHT(?) the character looks UP. If you hold DOWN(?) the character looks RIGHT. And if you look LEFT(?) the character looks DOWN. I am using a Top-Down camera, not sure if that matters but that is why I said "Looks up,right,down,left" I think my problem is in this code here
local rootPart = player.Character:FindFirstChild("HumanoidRootPart") rootPart.CFrame = CFrame.new( rootPart.Position, rootPart.Position + Vector3.new(inputObject.Position.x - centerPosition.x, 0, inputObject.Position.y - centerPosition.y) )
If you need more information just comment here and I won't mind. I believe I need to add an offset of some sort but I'm not quite sure. Any help is appreciated and I look forward to your replies. Thanks!
local rootPart = player.Character:FindFirstChild("HumanoidRootPart") rootPart.CFrame = CFrame.new( rootPart.Position, rootPart.Position + Vector3.new(inputObject.Position.x - centerPosition.x, 0, inputObject.Position.y - centerPosition.y) ) * CFrame.Angles(0, math.rad(-90), 0)