#I'm new to Unity, is it possible to cancel the reload animation by sprinting?

1 messages · Page 1 of 1 (latest)

limpid badge
#

Been messing with the FPS Animation pack a ton and learned a ton of cool things around Unity; but have been having trouble with this.

grim void
limpid badge
grim void
limpid badge
grim void
#

That's an example for the FPSController script, just find the OnSprintStarted method there and insert that crossfade line

limpid badge
limpid badge
#

I also tried "Idle" as well, but no dice. This one is really messing me up lol

grim void
limpid badge
#

Oh yeah, I had ended up doing that, but sadly no dice. Reload anim plays without interruption

grim void
#

Could you share the full code?

limpid badge
#

Really? Let me try again on an unedited controller, maybe it's something on my end, if not I'll share the full code!

grim void
limpid badge
#

Yeah for me the weapon's reload animation was still playing, basically eating that input on sprint

grim void
#

Then, get back to the OnSprint method in the FPSPlayer, and add this line: GetActiveWeapon().WeaponAnimator.Play("Idle");

limpid badge
# grim void Okay, then everything is functioning correctly on your end. To stop the weapon a...

The only script that (I think) you're talking about that I could find was the Weapon script inside of each weapon from the demo; but I error when putting

public Animator WeaponAnimator => weaponAnimator; since weaponAnimator doesn't exist;

I'm sure I'm in the wrong script; and since I am, GetActiveWeapon() errors as well since the FPSController doesn't have access to the animator I'm guessing, because that's also erroring.

I see that the Weapon script DOES have an animator named _weaponAnimator that's private; but setting it to public hasn't helped me much either so I'm not going to play with it too much haha

grim void