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:
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.