How do I make a better collision?

Get help using Construct 2

Post » Tue Jan 05, 2016 2:28 am

Hello everyone! :)
I've been using C2 for like a year and yesterday was the first day that i used the Physics behaviour, the idea is to make my character throw a C4 randomly, but the behaviour seems to be making a bad usage of the collision box, i'll attach a print of the game so you guys can better understand what i'm trying to say.
Image
My character is actually split in two Sprites, one of them have all the animations and the other is used as the collision box, i used the same technique on the C4, the difference is that the C4 have the Physics behaviour instead of the Platformer, and as you can see, he's kind of "skipping" one pixel from the ground. :(
Theres any way to fix it? :?:
I'm so sorry if i said something wrong, english in not my main language. ;)
Image
B
39
S
14
G
2
Posts: 120
Reputation: 3,454

Post » Tue Jan 05, 2016 3:31 am

Is the collision box drawn to the full size of the graphic? Also, check or try changing the position of your image point so that it is higher up, forcing the graphic to go down lower. Other than that, it is hard to tell without a capx
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,273

Post » Tue Jan 05, 2016 10:10 am

Hello, TheDom! Thanks for giving me a bit of your time :)
So, yes, all the collisions and image points are ok, i tried to change some things but nothing seems to make any difference, like using the bounding box collision from the Physics behaviour or making all the graphics with pair numbers for the size. :(
Well, here is the Capx, so you can better understand what's going on.
https://drive.google.com/file/d/0BzWC9KLseKfkajB6UG1oUXVJOFk/view?usp=sharing
And thank you again! :D
Image
B
39
S
14
G
2
Posts: 120
Reputation: 3,454

Post » Tue Jan 05, 2016 11:13 am

mateussales wrote:Hello, TheDom! Thanks for giving me a bit of your time :)
So, yes, all the collisions and image points are ok, i tried to change some things but nothing seems to make any difference, like using the bounding box collision from the Physics behaviour or making all the graphics with pair numbers for the size. :(
Well, here is the Capx, so you can better understand what's going on.
https://drive.google.com/file/d/0BzWC9KLseKfkajB6UG1oUXVJOFk/view?usp=sharing
And thank you again! :D


You will need to upload a capx, not a caproj file for others to take a look..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jan 06, 2016 5:04 am

Image
B
39
S
14
G
2
Posts: 120
Reputation: 3,454

Post » Wed Jan 06, 2016 8:09 am

Here a simple hack for your problem:
Image
ImageImage
B
102
S
46
G
22
Posts: 772
Reputation: 21,593

Post » Wed Jan 06, 2016 2:26 pm

You can also simply modify the collision box of the C4 so that all points are 1 pixel within the object.
This means that the top left point position becomes 1,1 instead of 0,0, the top right point position becomes 5,1 instead of 6,0, and so on.

Physics is tricky, and using such a small graphic adds to the trickiness.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,319
Reputation: 87,487


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests