|Topic was automatically imported from the old Question2Answer platform.
I’m facing a problem where a collision shape is being disabled but I can’t really figure out why.
In my animation player I disable the collision shape at the start of a dodge animation but re-enable it a couple frames before the animation ends. The animation plays all the way to the end every time because at the very end I call a dodge_animation_ended() function to bring my character from the dodge state to an idle state.
Is there any way to monitor the collision shape and find out what exactly is disabling it?
Any help is appreciated!
prints in critical places of a code to learn when it is disabled. I bet it just doesn’t get enabled again. Post your code here and we will find the issue
Thanks for the answer
Using prints was the first thing I did but I thought maybe there’s a better way of debugging.
The collision shape is actually never disabled in my code itself. I disable it only in the animation player during the dodge animation and re-enable it again towards the end of that animation.
I use a simple state machine for my character and have made sure that it works properly (As you already suggested with prints, checking how the state changes).
I was able to fix my problem by adding a property track to my other animations (running, etc.) and keying the collision shape at the very first frame as being enabled. Might not be the best solution but it works.
Do You know why this works ?
Propably your dodging animation was getting cancelled midway by other animation or sudden change of state, and shape enabling was never reached.