Hey
Trying to rotate a character
Here is the code I have so far which sucessfully rotates the player 45 degrees on the y axis
game.Players.PlayerAdded:connect(function(ply) game.Workspace:WaitForChild(ply.Name) local character = game.Workspace[ply.Name] character.Humanoid.AutoRotate = false while wait() do character.Torso.CFrame = CFrame.Angles(0,math.rad(45),0) + character.Torso.CFrame.p end end)
However, when rotating 45 degrees on the x axis the character is always trying to rotate itself back to standing up
game.Players.PlayerAdded:connect(function(ply) game.Workspace:WaitForChild(ply.Name) local character = game.Workspace[ply.Name] character.Humanoid.AutoRotate = false while wait() do character.Torso.CFrame = CFrame.Angles(math.rad(45),0,0) + character.Torso.CFrame.p end end)
If there were some way to stop the character from trying to auto flip itself back to normal orientation then that would fix the problem. I have tried turning off autorotate but this only fixed the problem on the y axis. I have also tried using bodygyro, but you can't set a particular rotation with that so that is not ideal.
Any help will be greatly appreciated
Im not a good scripter, but based on my knowledge, while wait() do is a much slower process to loop stuff. Instead, you would need to use Heartbeat, which is faster.
game.Players.PlayerAdded:connect(function(ply) game.Workspace:WaitForChild(ply.Name) local character = game.Workspace[ply.Name] character.Humanoid.AutoRotate = false game.RunService.Heartbeat:Connect(function() character.Torso.CFrame = CFrame.Angles(math.rad(45),0,0) + character.Torso.CFrame.p end) end)
I have the same problem as well.
To "temporarily" overcome this problem, I used
humanoid.Sit = true -- or humanoid.PlatformStand = true
The major down side to this solution is that humanoids have a "timer" to get up, so it isn't the best solution for me. It can work for your code though,