[Physics] How to change center of mass?

Get help using Construct 2

Post » Sat Jul 27, 2013 6:08 pm

Hi,

My collision box is set to Bounding Box(it's what I need it to be).
That means the center of mass is in the center.

How do I change the center of mass to the bottom of the object?Xionor2013-07-27 18:09:09
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Sat Jul 27, 2013 6:27 pm

There's no simple way of doing this but you could create a custom collision polygon where it is hollow near the top, so most of the mass is at the base.

you could also experiment with using distance/revolute joints to pin a tiny sprite 1*1, with super high density to wherever you want to add mass on the bigger objectkeepee2013-07-27 18:28:09
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Sat Jul 27, 2013 6:33 pm

The C.O.M. is based on the collision mask, so by making it bottom heavy, but setting the Physics:Collision mask property to Bounding Box, you should be able to get the effect you want.blackhornet2013-07-27 18:35:16
ImageImageImage
B
71
S
19
G
179
Posts: 3,473
Reputation: 102,662

Post » Sat Jul 27, 2013 6:41 pm

@blackhornet
it needs to be set to collision polygon.. bounding box just puts COM back in middle
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Sat Jul 27, 2013 7:04 pm

Hmm, unfortunate.
ImageImageImage
B
71
S
19
G
179
Posts: 3,473
Reputation: 102,662

Post » Sat Jul 27, 2013 8:11 pm

@keepee
Issue is i need the object to collide at the Bounding Box, by game design. So a Custom collision polygon doesn't work for me.

I'll try the thing with a tiny invisible superheavy sprite attached to the bottom of the object, see if that helps : )
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Sat Jul 27, 2013 8:32 pm

@Xionor

I meant something like this:
https://dl.dropboxusercontent.com/u/53374990/Pics/bottomheavycollisionpolygon.png

I tested it and it works.. you can jump on top of it and you don't fall through or anything, it acts just like a bottom heavy box

also it's a vending machine.. so it suits :D

only problem is it's >8 polygon points, so the image editor will understandably nag you every point you add above 8
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Sat Jul 27, 2013 9:40 pm

@keepee

Wow 0.o That's genius!!
I'd never have thought of that solution and didn't even consider you could make dents like that in collision boxes. This should be put in a tutorial or something! : o

Thank you a ton!Xionor2013-07-27 21:54:08
B
10
S
3
Posts: 233
Reputation: 1,537


Return to How do I....?

Who is online

Users browsing this forum: Greaver, luckyrawatlucky and 10 guests