#Popping into idle animation and breaking collision on button press

1 messages · Page 1 of 1 (latest)

fringe slate
#

Hi, I've made progress with an isometric prototype for a game where a duck is able to swim and jump in and out of the water. I ran into a problem with my code, however, where once I finally implemented the ability to jump out of the water, the idle animation of the duck pops in upon pressing the jump button and suddenly the duck ignores all collisions until the jump button is pressed again. Before this point, I also had a glitch where if I broke the physics enough, sometimes the duck would walk on water regardless, but I have no idea what's causing it. I've tried many times to fix the code myself and checked for tutorials but I feel stuck.

What will I need to do to make it so instead of the duck popping into the idle pose and breaking collision, they immediately cut to the jump animation on the animation tree and either play the land-based animations when coming into contact with land, or initiate the swim animation when colliding with the water (Area2D)?

Here's the code player code:

https://pastebin.com/j6wH3DwW

fringe slate
#

For greater context:
Analyzing it deeper, when the jump button for the duck triggers the animation, it temporarily acts like the jump animation has already been triggered, and before it's been finished (which is when the collision returns) it jumps to the idle animation instead.