NEED HELP WITH COLISION DETECTION

K

koopy eacret

Guest
Hello,I Am Using Gamemaker 1.4 And I Am Working On A Platformer,Now I Want To Detect When My Player First hits the ground.like the very second he hits the ground. I want Some Kinda "IF STATEMENT" That Detects For The Very Second The Player Collides With The Ground.not If He Is Colliding At All,Just If He Just Did.
 

jobjorgos

Member
You mean something like this?

Step event:
Execute a piece of code:
Code:
if place_meeting(x, y+1, obj_ground){
     //your action here
}
 
K

koopy eacret

Guest
No i mean like the Code Only Runs ONCE, That Time Being The Very Second You Collide.Not At All Times When You Are Colliding.
 

DarthTenebris

Definitely not a Sith Lord
If you want the code to run literally once, you could do:

Create Event:
Code:
run = false;
Collision Event:
Code:
if (run == false) {
     //Collision code
     run = true
}
That will make the code run literally only once, for the first time you collide. But the next time you collide, it won't run again (unless you set the variable run to true somewhere else in your code).

Hope I helped, sorry if it wasn't what you're looking for.
 
K

koopy eacret

Guest
OMG, Thank You, You Have No Idea How Long I Have Been Needing This!
 
K

koopy eacret

Guest
I Love The Pacing,It is so well timed in my Opinion.
 
Top