Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Gun animations work just fine in the animation editor, but they glitch when played in-game?

Asked by 4 years ago
Edited 4 years ago

Another odd issue involving animations, but this time it's a weird offset glitch(?) happening on the gun animations I made, it basically makes the gun stay in weird positions during the animation instead of being in the right spot.

This is what the animation is supposed to be like: https://prnt.sc/uoilyj

This is how the animations is in-game: https://prnt.sc/uoin3y

This is the animation timeline: https://prnt.sc/uoinr9

And this is the script that sets the Motor6D:

local function equipGun(player, weapon)
    local char = player.Character

    local newWeapon = weapon:Clone()

    local motor6D = Instance.new("Motor6D")
    motor6D.Part0 = char.RightHand
    motor6D.Part1 = newWeapon.Handle

    motor6D.Parent = newWeapon
    newWeapon.Parent = char
end

P.S: The gun is a model, and the handle is an invisible part connected to the gun's body that is connected to the rest of the gun parts. The animations are mine and they are played on a LocalScript in StarterCharacterScripts

If needed, I'll edit this to answer questions and provide more details.

0
Try adding reseted keyframes in the keyframes you dont want to move intead of leaving it blank. MAYBE could be a solution avoiding a blank keyframe of other animation overlaping. Necro_las 412 — 4y
0
I'm sorry for the inconvenience but I actually dont know what that is or how to do it arthurdaniel91 72 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

I believe that two issues could cause this.

1) Is the handle sitting correctly in the hand of the humanoid compared to the weapon? If the handle is in a weird position this can surely happen. Try moving the handle and rewelding it and see if the gun "glitch" position has changed. If not, there is another issue.

2) Do you weld/attach the weapon to the handle via script? If so, try connecting them in studio directly. The script may not be quick enough at attaching the weapon, resulting in the weapon being very weird compared to the handle.

0
To answer both questions: No, the positions doesn't change, the gun is welded manually with a plugin and stored in ReplicatedFirst, and the gun's Handle is positioned through the animation, and deleting the Handle's keyframes only makes the handle appear in yet another weird position. arthurdaniel91 72 — 4y
0
I changed the gun's Handle position and re-welded it, exact same result, and just incase this is crucial, there is no other animation playing that overlaps the Handle's current keyframe arthurdaniel91 72 — 4y
Ad

Answer this question