Why does my player only jumps if I’m walking left or right but not changing animation to “jump”?
When my character is still, if I press up key the game freezes even before he jumps or change animation.
Because you’re setting the left/right animation after the jump event, in the events with conditions “
The scene variable sentido = ...”. So when you press right and jump, the animation for jump is set, but overwritten in the event immediately after.
Do you reset Sentido anywhere? If not, the events with conditions “
The scene variable sentido = ...” will fire one of the actions every single frame.
This is not the cause. If I remove everything and leave just the Action: Up key is pressed…, my game still freezes. I tried to rename my animation, replace my sprite, call it for its number instead of name, nothing works.
If no key is pressed sentido=0
I think your way to move the player is weird but anyway, this can fix your current issue
Just add the walk event as a subevent and make the main event like if player is on floor like
Player is on floor
Do sentido 1
Do sentido 2
If you want the player moves in the air where he is jumping add another event
Player is Jumping
If Sentido 1
Change position X to
if sentido 2
Change position X to
That’s not shown in the screen shot. Is it happening elsewhere?
So the only action is key pressed? And absolutely nothing else? No other events at all? Just the one event? And it still freezes?
The problem is I disabled everything and left just the Condition/Action to jump my player and it still freezes
Check if your player has gravity or show me the hitbox Platform behavior
Look some of my player moves events maybe helps you.
This is for direction. I just use the Platformer behavior Simulate left/right to move my player.
I disabled the default controls of my hitbox.
Well, I think that’s enough for today.
I’ll check again tomorrow for some solution. If not I’ll try to redo it like You did. Thank you both for while.
Maybe your jump animation is corrupt or missing, or maybe something went wrong with your object.
Make sure all your sprites are the same size, then delete and recreate the object.
For testing, you can also remove the animation action and jump speed action.
And you can press ctrl-shift-i in the preview to look for errors in the Console tab.
I get this error when I jump:
As I said I changed the sprite (they are all the same size). Even if I remove the sprite and leave just the hitbox my game freezes the same way. I changed my hitbox to visible to check if it’s jumping, but it’s not.
I noticed when I check the hitbox of my sprite “jump” the mask is in red. It’s exactly the same sprite of one of my walking sprite sequence. Any idea why this happens?
Well, I think I solved the animation change, but now if I’m walking and press to jump, my player jumps vertically. It stops before jump.
This kind of error happens when a texture is missing in an animation.
ok! I fix that too. Actually, I did all my script from the start. But I have another animation that doesn’t work. When a bullet hits my player, I have a “hit” animation, but it doesn’t work.
Try this close your project and reopen, then go to Game Settings → Resources
Save close the project, close GD and reopen
Maybe this helps to clear the resources
Already did that. Still doesn’t work!
This is classic animation conflict. Make sure only one animation event plays at any time.
But please open different topics for different issues, this is getting messy.