Enemy Overlap Issue

This forum is currently in read-only mode.
  • Hey everyone!

    I have been working on this seemingly simple problem for a while now.

    I have a "pool" sprite that allows the player to swim. When he overlaps the "pool" he will activate the built in Construct "Wave" effect I gave him, and I have to say, it looks pretty cool!

    So I wanted to do the same for the enemies. The problem is, when there is one enemy overlapping the water, all of the enemies end up activating the "Wave" effect which is not what I want. How can I make it so that only the enemies who are directly overlapping the pool activate the effect? Thanks in advance. :D

  • I figured it out! ^_^ It was really simple.

    I had the events:

    +Enemy is overlapping Pool

    ->Enemy activate Warp Effect

    +Else

    ->Enemy deactivate Warp Effect

    What I should have had was

    +Enemy is overlapping Pool

    ->Enemy activate Warp Effect

    +Enemy is not overlapping Pool

    ->Enemy deactivate Warp Effect

    So simple lol.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It isn't that simple. I'm glad you found it by yourself. The problem is, that one would think, that logically the first approach should be right.

    IF something is so do this ELSE do something else

    But that logic breaks, if the event picks something.

    Enemy is overlapping Pool <- this picks the enemy-instances that are currently overlapping Pool

    Else <-this oviously doesn't pick anything. But in Construct, if no specific instance is picked the action will be performed at ALL instances of the object.

    So, good work, that you solved it by yourself.

  • Yeah, I'm glad it ended up working too. Sometimes it would pick three or four. Other times it would pick all of them. The else action ended up being too random for me this time. But, I'm glad I was able to find an easy workaround. Thanks.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)