How to fix animation delay when equipping tool?

currently doing some work on firearms in roblox using standard tools

issue goes as follows → tool equips → first line of code in :Equipped() function is setting the motor6d to right arm → equip anim plays

theres always a sort of microsecond twitch that occurs when the animation starts and its never seamless. i have tried setting the tool hold animation off in the animate script but to no avail. i have seen this be seamless in other games tho and im baffled how they make it work. this does NOT happen when switching from tool to tool, only when unequipped and equipping a tool

clips of the issue:

notice towards the end as i start switching from gun to gun the animations play seamless and dont twitch out as they do if i equip normally
this only happens on players respective clients and not from another players perspective, on which the animation is seamless how it should be

have you tried using task.spawn?

2 Likes

Can you show a Image (Why would you lol) or video of this occurring?

There isn’t really much info here to help


Assuming you mean a Delay in the animation, its a normal occurrence (Take this with a grain of salt)
Could be:

  • Animation loading for the First time
  • Delay Inside Animation
  • Connection Based Issue (Using a Server Script to Play Animations)

Possible Solutions:

2 Likes

shouldve put a clip immediately, my bad

as you can see in the start when i go from no tool equipped to a tool the animation twitches slightly in the start, its more visible on one animation than the other but both have it, and towards the end i start switching from tool to tool and you can clearly see the animation becoming seamless and starting how it should

i dont see a use for task.spawn because this is not an issue of a line of code playing too late, i also preload the animations, play them on a local script and there is no delay inside the animations either. one thing thats funny is that from other players perspective the animation is actually in fact seamless how it should be, just not on the players respective clients

i havent. in what context would i use task.spawn here?

task.spawn is used to fire functions “immediately” according to documentation

i dont see a use for this, because clearly a delay in the line of code is not an issue

bump bro im literally bouta pay up for a solution somebody help ong

hello, you probably long forgot about this post and probably found a solution… but I am gonna post mine way of removing the equip delay for tools for future refrence if anyone else stumbles onto this topic.

the easiest way is actually the animation:Play() part of the script. you see, the () parameters of the play function are fade in time, weight, and speed. in roblox, the fade in time is by default set to like 0.1 or something, which makes that short twitch before fading into the animation completely. so to avoid that little lag, you should set the :Play() function to “animation:Play(0,1,x)”. x being your desired speed.

here’s the end result: Roblox Studio 2023-07-12 10-57-30_Trim

its not perfect, there’s still like a 2 frame twitch, but that’s as clean as its gonna get if you only wanna do things via server scripts

11 Likes