I was playing around in the Roblox Studio testing out things and a glitch happened. So I don’t really know if this is an Animation issue but the character rotates in front whenever I crouch or equip a tool.
I don’t really know what causes this issue, it has happened to me before and I just didn’t care that much but now its annoying.
That is the crouch animation.
So im guessing thats the problem?
This is the script for it
local Player = game.Players.LocalPlayer
repeat
wait()
until Player.Character
local Mouser = Player:GetMouse()
local name = Player.Name
local Character = game.Workspace[Player.Name]
local Crouching = false
local Sprinting = false
local debounce = false
local Animation = script.Animation
local animeTrack = Character.Humanoid:LoadAnimation(Animation)
Mouser.KeyDown:Connect(function(key) -- Start Crouching
if key == "c" and Crouching == false and Sprinting == false then
Crouching = true
for i = 1,2 do
wait()
Character.Humanoid.CameraOffset = Vector3.new(0,-3,0)
end
animeTrack:Play()
animeTrack:AdjustSpeed(0)
Character.Humanoid.WalkSpeed = 8
Character.Humanoid.JumpPower = 0
local Event = Character.Humanoid.Running:Connect(function(speed)
if speed == 0 then
animeTrack:AdjustSpeed(0)
else
animeTrack:AdjustSpeed(1)
end
end)
else
if key == "c" and Crouching == true and Sprinting == false then -- Stop Crouching
Crouching = false
for i = 1,2 do
wait()
Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
end
animeTrack:Stop()
Character.Humanoid.WalkSpeed = 16
Character.Humanoid.JumpPower = 50
end
end
end)
Nothing sticks out in your code. By any chance are you animating meshes and bones/HRP in the animation? In this animation, for example, I have references to meshes that do nothing. Animating the HRP might cause this tilt.
Also check that your default HRP orientation is not tilted. An idle animation might be providing the illusion that this model is properly upright.