Hi! So I have a problem and I don’t understand why it happens. I have a topdown-rpg and I have a working dialogue system. My problem is that if I start the dialogue while still moving, the character will take a small, tiny step in the previous direction after the dialogue ends (and it looks ugly since the walking animation is very noticeable). Why does this happen? How do I get rid of it?
I added these commands but they don’t seem to help. I also set my deceleration in the TopDownMovement behavior to be 900000 and the step still happens.
Any suggestions? Thank you!
Edit: In my understanding, there is no way to remove forces given by a behavior. It can’t be fixed? The next best thing was to try to hide it by not letting the animation change while the character moves. So that what I did.
All behaviors keep momentum when they’re disabled, because the logic isn’t wiped.
You’re probably better off trying to stop the player’s movement speed before disabling the behavior. As far as I know movement type events are not compatible with one another, top down isn’t using normal forces, platformer behavior isn’t using top down, etc.
Just use the “Change the speed speed on X/Y access” actions and set them to 0 for your player object before you deactivate the behavior.
Edit: For platformer behaviors, same concept, just use the current speed actions.
I can not believe it. I guess I have no clue what I’m talking about. It works. I have wasted to much time and energy trying to first fix and then hide it. But it really is that simple: change the speed before disabling the behavior.
Because an old comment of mine was resurrected for this: I tried setting current horizontal speed to zero before disabling platformer behaviour, but that doesn’t work for me to completely remove the slight jitter when platformer behaviour is enabled again, hence my old post about hiding that jitter with a dedicated event. My character does a brief little ‘kick’ and moves forward slightly once dialogue ends, or my inventory closes, when platformer behaviour is enabled again. Thanks.
Here’s the preview if you want to test it yourself. WASD to move on keyboard, holding D and pressing 1 stops the hero instantly, and pressing 2 has no jitter. (I removed all other animation frames just to make it easier to check).
Thanks for sharing that. I do the same thing with mine as you’ve shown in your screenshot. Perhaps my problem is caused by something else, or a simple case of ordering my actions differently. I was only discussing it at all because Valo requested help with this on another thread that I spent time on this morning and needn’t have. However, some good has come from my mild frustration over that because now I know that you don’t have the jitter issue and perhaps I can fix it in my own project without the need for a hacky event that hides it.
Edit: the context around ‘resurrected’ is me being a bit grumpy . Sorry. Nobody’s fault.