Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I have 2 round objects, A and B. Object A will move towards object B in a bullet behaviour. I want the object A to stop immediately on collision with object B. I am thinking of getting the collision coordinate so that I can set the position of object A. What is the best way to detect this precisely? Or any other approach that's better?
If they are the same size:
This might help.
Develop games in your browser. Powerful, performant & highly capable.
Thanks for the replies!
I tried your expression but it doesn't give the result I want. As in, sometimes it will be off by a few pixels. Does the collision polygon affect the results? The objects are different sizes.
They aren't the same size.
Just use the position the object had on collision....
I tried that but sometimes the ball went further in. I guess it's due to collision polygon. The ball is round but there are only 8 collision points. I am guessing certain collision area is within the ball perimeter and thus it stopped slightly later. Do you have a solution to this? Not sure if adding more than 8 collision points is a good idea but that's the only solution I can think of.
I found the solution. Basically I just use a dummy sprite to get the angle between the two balls and set the position towards that angle. Thanks for the tips guys.