0 Favourites

How do I trigger an event on overlap of 30% or more?

  • I'm designing a small game in which a ball moves on top of disappearing platforms. When a ball is on top of the platform and the platform disappears, I let the game trigger the following event:

    Player - is overlapping platform => Restart layout

    - Platform is invisible

    Problem is. The same event is triggered whenever even a single pixel "hits" the invisible platform. Is there any way I can restrict this behaviour to something akin to "30% is player is overlapping platform"?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Use overlap at offset. Only you set it in pixels

    In my example you have to set for both sides, so you cave to make 2 sets of conditions.

    one might be overlap 20,0 (20 is X and 0 is Y)

    The other would be -25,0

    This way the overlap works from both sides.

    I use this in a platformer of mine:

    Player > is Overlapping Enemy 25,0 > do something

    Player > is Overlapping Enemy -25,0 > do something

    In your case it sounds like you'll need change overlap for Y and in only one direction. Hope this helps.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
74 4,516
Dalal's avatar
Dalal
Unread hot topic
50 4,211
inquiesco's avatar
inquiesco
Unread hot topic
99 10,155
karshinkoff's avatar
karshinkoff