Gun goes teleports to torso right before animation plays

i know this might sound like a minor issue but i want to make this as smooth as possible
but basically the issue that the gun goes to the middle of torso just before the animation plays

also how i holster weapon, i used blender’s child of constraint
and i created motor6d in the humanoidrootpart rather than the hand in most weapon animations
reason being i can add more flexibility

blender animation

roblox animation - in studio

if you look really closely you see the gun teleport to the torso and go back the hip/waist or the side of the right leg

then it quickly tweens back to the leg and animation plays soon after

an image depicting the gun in torso
gunn

on the first keyframe the weapon is holstered and NOT in the middle of the torso

the script automatically attaches the gun to leg
which allows the player to walk around with the gun to the leg

local character = player.Character
local weld = char.HumanoidRootPart:FindFirstChild("Frame")
weld.C0 = CFrame.new(0.6, .25, 0) * CFrame.Angles(0, math.rad(90), math.rad(180))	
	
local eagle = deagle:Clone()
eagle.Parent = character 
	
weld.Part0 = character ["Right Leg"]
weld.Part1 = eagle.Frame

then i have this code to attach the gun to the humanoid root part

local char = player.Character
local rootPart = char.HumanoidRootPart
local eagle = char:FindFirstChild("Deagle")
local weld = rootPart:FindFirstChild("Frame")
	
weld.C0 = CFrame.Angles(0, math.rad(90), math.rad(180))
weld.Part0 = rootPart
weld.Part1 = eagle.Frame

edit: one more issue, is i don’t know how to smoothly transition to the idle animation
without it twitching out

i did try to play the idle animation right after the walk animation, but now the idle animation overlaps the walk animation - even tho i set idle animation to a lower priority to the walk animation

humanoid:ChangeState(Enum.HumanoidStateType.Landed) --this helps a bit
--idleTrack:Play()
character.Animate.idle.Animation1.AnimationId = "rbxassetid://15962913442"
character.Animate.idle.Animation2.AnimationId = "rbxassetid://15962913442"
character.Animate.walk.WalkAnim.AnimationId = "rbxassetid://15963022304"
--don't know why there are 2 idle animations, but i set both of them to the same animation because
--i have no idea what im doing

when playing the animation track just set the fade time to 0
animationTrack:Play(0)

ignore all below

ok, i think i made a tiny bit of progress,

my mistake was putting the gun in the center of the torso
image

instead of gun initial position to be in the center/torso
position the gun to where you want it to be at the first frame of the animation
such as the gun being holstered to the side
image
next weld it to the humanoid root part, keeping the offset

after doing that the gun SHOULD spawn where you want it to be, in my case the leg
and apparently, the animation first eases each motor6d’s position to the first keyframe before playing the animation

wrongg


image

correcttt

(might have to reanimate the gun, however the rest of the animation is fine, because the gun is set at an offset)

oh wait i forgot to mention one more thing, buttt
make sure to put the offset of the weld into the code
do this before you play animation
image

ok update, i am working on fixing the offset, anddd its looking nice, not finished but will be

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.