Crouch is floating when equipping any tool

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to fix the crouch issue

  2. What is the issue? Include screenshots / videos if possible!
    Whenever i equip an gun tool or any tool when crouching
    its like floating up

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried to change the animation nothing work

this is screenshot of when i equip any tool (NO JUST RPG!!!)
when i crouch
image

This is screenshot of normal crouch
image

local Player = game:GetService("Players").LocalPlayer
local Values = Player:WaitForChild("Values")
local Character = script.Parent
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("CROUCH")
local Animations = script:WaitForChild("Animations")
local Crouch = false
local Walking = true
local PlayingWalk = false
local AnimationsTracks = {}

module.Crouch = function (self)
	Crouch = not Crouch

	if Crouch then
		AnimationsTracks["Idle"] = Humanoid:LoadAnimation(Animations:WaitForChild("Crouch"))

		AnimationsTracks["Idle"].Priority = Enum.AnimationPriority.Idle

		if AnimationsTracks["Idle"] then
			AnimationsTracks["Idle"]:Play()
			Remote:FireServer()
		end

		RunService.RenderStepped:Connect(function()
			if Crouch then
				local MoveDirection = Humanoid.MoveDirection

				if MoveDirection.Magnitude > 0 then
					Walking = true
				else
					Walking = false
				end
			end
		end)
	else
		if AnimationsTracks["Idle"] then
			AnimationsTracks["Idle"]:Stop()

			Remote:FireServer()
		end
	end
end

module.Init = function ()
	local self = setmetatable({},  {
		__index = module
	})

	UserInputService.InputBegan:Connect(function(Input, processed)
		if processed then
			return
		end
		
		if Input.KeyCode == Enum.KeyCode.C then
			self:Crouch()
		end
	end)

	return self
end

module.Init()

you can try replacing the “toolnone” animation in the character’s animation script with an empty animation, or simply remove it

btw. are you using welds?

first of all the animation is 100 percent fine and the tool are 100percent fine

For me i dont understand why do everytime i crouch any tool float up while im crouching

Animation and tool has no problem is the script that causing this problem

here how it look like
image

i still think its due to your animations or welds, its possible that weapon idle animation with animated torso keyframe is blending with crouch animation, ensure that crouch animation has higher priority

Ok but when im using the passport tool or sword tool from the roblox toolbox

its also causing the same issue so this is no ONLY gun tool idle animation
but another tools as well
image

1 Like

default roblox Animate script which is located in the player’s character has ToolNoneAnim as I mentioned before, if its not removed nor overwrited it could cause problems with any tool in your game

1 Like

This is just about the crouch animation when i equip tool
the rest is fine my point is how to fix this kind of issue?
how is this pointing all tool too?

1 Like

default ToolNoneAnim has Torso keyframes, whenever any tool is equipped this animation is played by the Animate script inside player’s character. this could be the reason why the character is lifting up

1 Like

So what do u want me to do in order to fix this problem for the crouch animation to avoid floating while equipping an tool

no being rude or anything just asking

1 Like

as i mentioned before, either remove the ToolNoneAnim or overwrite it with empty keyframes animation

1 Like

where can i remove the toolnone animation like where it is located

1 Like

Animate script is automatically put in the player’s character everytime he spawns. you can copy it in the test mode and then put it into StarterCharacterScripts - everything from StarterCharacterScripts is being copied and put into character whenever its added to the workspace, if you put your Animate script there it would overwrite the default one, meaning you can edit it as you want.

inside the Animate script, theres animateTool function that you can comment out in order to stop loading the default tool animations.

function animateTool()
	
	if (toolAnim == "None") then
		playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
		return
	end

	if (toolAnim == "Slash") then
		playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
		return
	end

	if (toolAnim == "Lunge") then
		playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
		return
	end
end
1 Like

Okay i already found what u mean but now what i do

1 Like

this is expected result (default tool animations arent loading and the character is holding the tool like it wasnt in his hand)


Im sorry but this do not help me i have some gun system and some tools with animation inside

and this mean is defaulting all the animations i have the game

the only problem is the crouch when equip tool

so basically idk if ure scripter or not i have an old script that i use to post the same topic about this
and that script no longer work but here

local TweenService = game:GetService("TweenService")
local Humanoid = game:GetService("Players").LocalPlayer.Character:WaitForChild("Humanoid")
local HumanoidRootPart = game:GetService("Players").LocalPlayer.Character:WaitForChild("HumanoidRootPart")

local CrouchAnimation = script.CrouchAnimation
local CrouchTrack = Humanoid:LoadAnimation(CrouchAnimation)

local CameraInfo = TweenInfo.new(
0.3,
Enum.EasingStyle.Quint,
Enum.EasingDirection.Out,
0,
false,
0
)

local CrouchedGoal = {CameraOffset = Vector3.new(0,-1.75,0)}
local UncrouchedGoal = {CameraOffset = Vector3.new(0,0,0)}

local CrouchedTween = TweenService:Create(Humanoid, CameraInfo, CrouchedGoal)
local UncrouchedTween = TweenService:Create(Humanoid, CameraInfo, UncrouchedGoal)

local inCrouch = false

local function Crouch()
if inCrouch == false then
inCrouch = true
CrouchedTween:Play()
Humanoid.WalkSpeed = 8
CrouchTrack:Play()

	HumanoidRootPart.CanCollide = false
	
else
	inCrouch = false
	UncrouchedTween:Play()
	Humanoid.WalkSpeed = 16
	CrouchTrack:Stop()
	
	HumanoidRootPart.CanCollide = true
	
end
end

game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessedEvent)
if gameProcessedEvent then return end

if input.KeyCode == Enum.KeyCode.C then
Crouch()
end
end)

Animate.rbxm (8.5 KB)
Insert this into StarterCharacterScripts in your game and try to reproduce the problem

but this is just gonna default my entire animation that i have??

1 Like

this will overwrite the default roblox Animate script with new edited version that doesn’t animate the tools

still same problem its defaulting my tool animation

did you insert the Animate script that i sent you inside StarterCharacterScripts?

1 Like