Better understanding of Collisions w/Construct.

For questions about using Classic.

Post » Sat Jun 18, 2011 4:09 pm

After spending some time playing around with Construct over the past few weeks I am trying to get a better understanding of how to correctly work with Collision Detection when using the various behaviors. One thing I noticed right away is , for example, if you applied car movement to a sprite and set various other sprites throughout the layout that where checked "solid" the car movement behavior handles the collision detection. This is also true for other behaviors that I had the time to play with.

The custom movement behavior however does not handle collision detection, as I would imagine it wouldn't, but I am confused on how to "correctly" work with collision detection when using the custom movement behavior. I have done a few tests with "On collision with another object", I have set various collision modes with the "On start of layer" event and ran a few other tests but I am still getting faulty collision detection. What I mean by "faulty" is I, for example, I created one square sprite in the middle of the layout along with another sprite that I created a car movement system for with the custom movement behavior. I then used the "On collision with another object" event followed with the "Bounce" action. I noticed that half the time when coming in contact with the square obstacle I would bounce off and the other half I would drive right through with a quick speed decrease as if the collision detection caught and then failed.

What I would really like to know is how to "correctly" work with collision detection when using the custom movement behavior. Any help is much appreciated. Thanks in advance!
B
2
G
1
Posts: 37
Reputation: 524

Post » Sat Jun 18, 2011 5:47 pm

"On collision", and "is overlapping" need to be continuous just like always.
In other words that condition needs to be checked every tick, start of layout just wont do.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sat Jun 18, 2011 6:09 pm

[quote="newt":onoubl8w]"On collision", and "is overlapping" need to be continuous just like always.
In other words that condition needs to be checked every tick, start of layout just wont do.[/quote:onoubl8w]
Thanks newt! I thought this might be the case but I kept thinking there must be a better way than to add all those collision checks to an every tick event. Much appreciated. :wink:
B
2
G
1
Posts: 37
Reputation: 524


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests