For you to get a quick idea: So you can place down those traps which slow the enemy down.
Here is the code:
It’s probably my 5th version and also the best working one so far. Now I believe the only issue is that sometimes… very rarely… they dont get their speed back when they stepped out of the trap. So its not 100% working. I tried to solve that with the delay at the end of collision, to make sure they are not touching anything else anymore
The big problem here is probably the collision and that I dont want to use tick. Since the enemy can be affected by one trap, then if there is a trap just right next to it, he overlapps with the second trap (while still affected by the first one) then at somepoint not affected anymore by the first one but already missed the first checks of the first collision entry.
Here you can see the critical points. If they move right in the middle of them and touching all traps. Or the moment when they just enter the next trap while still touching the last one.
I believe a tick event would make that much easier, but I try to avoid that since they could be many traps, and many enemies effected by them.
Im happy for every suggestion.
Thanks for your time!