Object overlap problem

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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...

  • 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)