Check collision during jump

Hi all,

As the title says, I'm looking for a way to check collision with an event and the player. The problem is that the event is always jumping. I can check the collision when the event land but I can't do it when it's in the air.

So i tried, instead of checking the tiles coordinate, to check the sceenX and screenY coordinate but something is wrong.

Can someone help me please?

var charX = this.character(0).screenX(); var charY = this.character(0).screenY(); var playerX = $gamePlayer.screenX(); var playerY = $gamePlayer.screenY(); if (playerX > (charX - 24) && playerX < (charX + 24)) { if (playerY > (charY - 24) && (playerY < (charY + 24)) { $gameMessage.add('Test'); } };

Thanks
where and how do you execute the code?
please provide screenshots if it is in an event
Don't you have like an extra ( at the part checking the y-axis collision?
où et comment exécuter le code ?
veuillez fournir des captures d'écran s'il s'agit
Thecode is in the event wich I want to collide what is in parallel. I can't put it somewhere else because it's spawned event ant many can be spawned on the same time on the map.

I'm not home now, I will put screenshot later.

Don't you have like an extra ( at the part checking the y-axis collision?
What do you mean by extra?
if (playerY > (charY - 24) && (playerY < (charY + 24))

You have:
4x (
and
3x )
Thecode is in the event wich I want to collide what is in parallel.
without the screenshot I can't be sure, but if I read your description correct then that will never work.
because if I'm right then the script command cannot be executed at the same time as the jump command, which means the checks are always between jumps and not during jumps.

That's due to how parallels work in reality as opposed to the theoretical description - you might want to follow the link to "bughunting" in my signature for some background knowledge about parallel events.
I just tested it and if you remove the extra bracket, it works.
Je viens de le tester et si vous retirez le support supplémentaire, cela fonctionne.
Oh I didn't see. I will try when I comme back home.

without the screenshot I can't be sure, but if I read your description correct then that will never work.
because if I'm right then the script command cannot be executed at the same time as the jump command, which means the checks are always between jumps and not during jumps.

That's due to how parallels work in reality as opposed to the theoretical description - you might want to follow the link to "bughunting" in my signature for some background knowledge about parallel events.
The jump is in the move route and the code is in event command so both of them execute at the same time. I tried with a console.log and it execite every frame. I will try to do what rpglord69 told me and if it doesn't work I will put screenshots.

Thank to both of you.
Thanks rpgLord69, it's working now.

How do I put the thread as "solved"?

Original thread: https://forums.rpgmakerweb.com/threads/check-collision-during-jump.161982/