[solved]Physics2 and Health extensions interrupt each other?

How do I…

When the “drop” falls on the “sand”, “drop” damages “sand” by its linear velocity(potential energy)

What is the expected result

Drop collisions sand, sand got damaged. If sand is dead, it’s deleted.

What is the actual result

Nothing happened. drops actually touched sand, but it’s not damaged. I added text and play sound event to check. They hit each other and velocity is surely more than 1, but the event does not work.

Related screenshots

(I didn’t know all of your games rules. So, I made assumptions. Not all of this might apply. If not. Add more details.)

I think the issue could be the trigger once. Once a drop object is touching a sand object then it’s not going to trigger again until no sand objects are touching any sand objects.

image

Another possibility is that it’s checking “just damaged” before the damage is applied. It’s a per frame check. At the beginning the sand hasn’t been damaged yet. The damage flag gets reset between frames.

I don’t know if you want multiple collisions. I tested it with 1 collision per drop and used an object variable for a trigger once.

my project: (click the green [code] and [download zip]
https://github.com/doug13579/gdevelop-rain-test

try me (it’s all automatic, no interactions)
https://gd.games/keith_13579/jittery-instrument

My events

edit: The velocity check was used before the Boolean idea. You could actually use it instead of the boolean.

image

This would also work if the motionless drops should be ignored. Or you could add a cooldown timer.

I didn’t use 0 for the velocity check because even just sitting on the sand, the drop didn’t seem to be at 0 velocity.

1 Like

Sincerely thank you. It was just matter of order. I replace them more simply.

1 Like

You’re welcome. Nice code. It’s definitely more efficient to do things like “is dead” as a sub-event of an action that applies the damage. There’s no need to check it at any other time.

1 Like