# Spawn particles on the point 2 object collide?

0 favourites
• 36 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
• Could anyone explain to me how i would go about spawning particles on a point where two objects collide?

Say one object hits another, instead of just spawning particles on a set image point, dynamically determine where the object one touched object 2 and spawn particles at that position. I would love to be able to do this just to add some realism.

Thanks!

• Hmm... sounds like a very interesting conundrum. I honestly can't think of any good way to do it. This almost seems like an engine limitation.

• If your colliding shapes are simple, like squares, you can calculate the point of collision with some effort. For more complex collision shapes it would probably require lots of effort to get working properly.

I recall there being some discussion about the same topic recently, so try the search.

• ## Try Construct 3

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

Construct 3 users don't see these ads
• I'd also like to know how to do this...

• Well ... With a bit of thinking ... you can easily achieve it (Kinda) , I didn't test it with more complicated shapes tho ...

Capx - My try :P

• There was indeed a discussion about this recently. Here it is: http://www.scirra.com/forum/solvedget-the-position-of-where-objects-collide_topic65970.html?KW=

Still didn't get quite the result I was hoping for in that thread, but for simple cases there is a solution that just requires a bit of maths.

If anyone does have a neat, preferably not third-year mathematics way to get the answer, I'd also appreciate it.

• It's not really a problem that can be solved with maths - the whole issue lies with the fact that we can't get the vertex points /collision position in the event sheet.

• That seems like something an update would do! Yeah, stop doing tutorials.

• Thanks for all the replies guys. My shapes are simple so ill give your solution a look over Whiteclaws. Thanks again guys.

• Having a feature built into the next update that allows the system to return the x,y co-ordinates of where two objects are colliding would be phenomenally helpful for me!

• Sorry for the necro, but been looking around for a solution to the same problem i'm having now. 4 years later and still no way to get this position? *sigh*

• If your collision polygons are rectangular or close to circle shape, you can calculate the collision point. Otherwise, not sure if this can be done..

• Also, for a irregular shape, such a thing would consume an awful lot of cpu power... And I really can't see how useful would that be.

• Say, when a spaceship hits an asteroid and you want to draw sparks in the spot of the collision

• I used this solution for a laser beam:

https://www.dropbox.com/s/gabg6r1yp5jgw ... .capx?dl=0

I'm guessing you can reuse this technique of stepping back in a loop for any object.

• 36 posts