i am trying to make a hiding animation but the player can rotate around and break the animation.
the animation is a simple 2 second animation. I want the player to not turn around while the animation is being played.
How am i supposed to fix this ?
J_Angry
(J_Angry)
May 14, 2024, 3:18pm
#2
You can manipulate the player’s camera in a LocalScript to make this work. I also had the same problem, and this code worked for me:
local Camera = game.Workspace.CurrentCamera
local Humanoid = Player.Character.Humanoid
local HumanoidRootPart = Player.Character.HumanoidRootPart
Camera.CameraType = Enum.CameraType.Track
Humanoid.AutoRotate = false
HumanoidRootPart.Anchored = true
(This code is oversimplified, modify it to your needs)
script.camerathing:FireClient(player)
script.Parent.OnClientEvent:Connect(function()
local Camera = game.Workspace.CurrentCamera
local Humanoid = game.Players.LocalPlayer.Character.Humanoid
Camera.CameraType = Enum.CameraType.Track
Humanoid.AutoRotate = false
end)
i tried using that with remotes because my script was a server script, but it seems to not work
J_Angry
(J_Angry)
May 14, 2024, 3:29pm
#4
Try anchoring the Character’s HumanoidRootPart as well. I forgot to include that in my previous code, because I think that’s what disables the turning.
Den_vers
(Den_vers)
May 14, 2024, 4:09pm
#5
Many ways, I believe there is a property on the humanoid called .AutoRotate
, but you could also use AlignOrientation
to keep the player facing the direction you want, it works smoothly.
1 Like
system
(system)
Closed
May 28, 2024, 4:09pm
#6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.