0 Favourites

Object overlap problem

  • Hi there, I just started to work with construct 2 and I want to create a Ball Physics simulator but I have one problem. When I click somewhere on the layout I create a ball but I don't want to be able to create one of the balls on top of another. I tried to add a series of System.compare two values events or System.is between values but they don't work since they do not compare to every instance of the ball created, just with the first ball object. I hope I made myself clear enough. Thank you in advance.

  • raz - What you could do is create a temporary object(about the same size as the ball) that checks for overlap - if the overlap is true, then don't create the ball. Something like this:

    ->On click - Create temporary object at click position

    -->If temporary object overlaps ball object - delete temporary object,

    -->Else - delete temporary object and create your ball object

    In fact, you might even be able to just create the ball, immediately test for overlap and delete it if there is. I'm just not sure if that would cause a problem with physics or not, and I can't test it where I'm at...

    Hope this makes sense...

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I just tested for overlap and it works...kind of...it also deletes the created ball, but that is actually better since now I can delete the extra balls that I want. Thx!

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
167 14,515
DMT2005's avatar
DMT2005
Unread hot topic
123 14,875
Zebbi's avatar
Zebbi
Unread hot topic
98 7,599
norum82's avatar
norum82