Not in collision anymore


i want to delete an object when he is not in collision anymore.

order of events
in collision with object A: nothing happen
when not in collision anymore with that object A : delete that object A

i write an event and it doesn’t work
what should i add ?


Hi, your conditions are contradicting each other. The player can be in collision or not in collision. According to your event you want to delete the object (Babypanda) if the player is doing both at the same time (colliding and not colliding).

the question is when you want to delete babypanda
Is when player collides with babypanda or when is not colliding with, because of both to run without any other check is not possible.

Just think
if me collide panda delete panda
if me not collide panda delete panda
in which case panda will be existing if i’m deleting it always.

If player is in collusion with panda set variable of panda to 1

If variable of panda =1
→ player is not in collusion delete panda

I’m not at home so i can’t use GD. What i want IS
Collision with panda number1 : nothing happen
When i’m not in Collision anymore with that specific panda, delete that panda.
Thanks everyone .

In order to do this you need to add an object variable like obj_var_collided = 0
When the player panda collision occurs you change the obj_var_collided = 1
Then check in other event if obj_var_collided = 1 delete panda, this new event must be outside of the collision event.

Just follow this steps.
in one event:
1.) condition: payer is collision with babypanda
2.) condition: trigger once
3.) action: delete babypanda

I think i might understand.
I wrote something but it doesn’t work.
Can you point me to what i did wrong.

Move the object var collided part out of the in collusion condition.

In collusion = 1 event
Not in collusion as another event

for the part i wrote, i followed your advice from 3 days ago.
But now i don’t understand.
Can you just explain more to me what i must change.

if you have more then 1 babypanda, i recommend using an actual object variable, not a global variable named object variable.

Yes, i have more than one panda. I will try some solutions when i’ll be home. But if you have Time, it will be cool to write the whole event. Because, i won’t lie, i’m Lost at what i must do.

Thanks for your patience

this is all you need.

this is exactly what i asked for.
But there something i didn’t think about before and released when i tried to play the game.
when panda are too close to each other, some panda dosen’t delete.

let me explain
panda A is at the left, panda B is at the right
when i go from left to right, it comes ot a point where i’m in collision with both panda at the same time. So the panda at the right doesn’t delete when i’m not in colison with him anymore.

i think the second panda should have is own variable ?
what do you think ?

You need to remove the trigger once, or just put them further apart.

Thanks. I am not at home. I need to remove the first “trigger once” ?

Correct. But it will decrease performance, so putting them apart is the better solution.
you should remove the first trigger once only, if necessary for your game, to be in collusion with more then 1 panda.

Thanks to everybody. I have another question about this. Should i start another thread or Ask here ?