# Weight in Physics

Get help using Construct 2

### » Wed Oct 05, 2011 9:30 pm

Hello, Dcrew here!

I'm wondering how to have an object wait, because I have box 1 and box 2 colliding with each other (top-down game) and box 2 is supposed to be triple box 1's weight and therefore harder and less farther to be pushed, I thought this could be done with the density settings but that doesn't seem to do anything!?
B
18
S
4
G
5
Posts: 226
Reputation: 4,087

### » Mon Jan 16, 2012 10:45 am

Yeah any ideas how to set weight?
I have simple game with throwing darts and rocks, throwing to the boxes little dart have pin behaviour. Dart has more power than a rock knock when stuck in a box

Chceck this out: http://dl.dropbox.com/u/44710358/angrynerds.capx

throw in long pole... weird huh? :Ddelgado2012-01-16 11:06:15
B
119
S
32
G
53
Posts: 1,896
Reputation: 39,569

### » Mon Jan 16, 2012 11:06 am

I believe density is the way to go, but it depends how you interact with physics, if you have a 8 direction character with physics on it just to activate collision, you won't be able to slow down the character.
The character must be driven by physics only for the density to work on him... I guess :D

Delgado, seriously... I... don't understand what you said.Yann2012-01-16 11:06:59
B
71
S
22
G
14
Posts: 1,494
Reputation: 16,660

### » Mon Jan 16, 2012 1:05 pm

The object's mass is density x area of collision mask. If one object's density is 3x another object's density, it only has 3x the mass if they have exactly the same area in their collision masks. Are you sure both objects have the same collision mask?
Scirra Founder
B
414
S
245
G
92
Posts: 25,202
Reputation: 200,345

### » Mon Jan 16, 2012 2:50 pm

Hey Ashley, would be possible to add a Mass parameter to the physics that overrides the mass of an object? Or that sets the density to match a specific mass?

I recognize that the mass based on the density x area have the benefit of adding realism to the simulation, but it also takes away control. It's very hard to design a game based on weight ratios among objects, because it's impossible to calculate the mass since we don't know the area value. If it's based on specific weights then it's just not possible to implement it right now.Animmaniac2012-01-16 14:51:27
Scirra Employee
B
173
S
55
G
17
Posts: 711
Reputation: 18,527

### » Mon Jan 16, 2012 3:06 pm

I second Animmaniac's idea!
B
44
S
24
G
13
Posts: 723
Reputation: 15,105

### » Mon Jan 16, 2012 8:57 pm

If I understood @delgado correctly, I think you don't really need the mass here.

What you can do is on collision between the dart and the rock, create a distance joint between the two (not a pin, pin isn't relied to physics, it might end up with funny results). You can also add an impulse to the rock, that is a ratio of the dart's velocity.

From there, I think it would make the rock/dart move as a single object and give the impression that the momentum of the dart was transfered to the rock.
New to Construct ? Where to start

Please attach a capx to any help request or bug report !
Moderator
B
311
S
128
G
101
Posts: 7,414
Reputation: 75,224

### » Mon Jan 16, 2012 9:17 pm

mass of object is one thing but when i pin projectile to another physics object this object behaves strangely.
Yann sorry for my english ;/
Also is difficult to me to understand when I read in English.

I think Kyatric is closest :)

wants to achieve two things:
First-arrow sticks to every object
and stone as the ball bounces

Is it difficult?

Capx is updated and add arrow
Choice weapon with 1 and 2 keydelgado2012-01-16 22:16:53
B
119
S
32
G
53
Posts: 1,896
Reputation: 39,569

### » Tue Jan 17, 2012 1:44 am

kyatric has it right.
rock & box collide: don't do anything
dart & box collide: create a distance joint between dart & box

dart density: small number
box density: medium number
rock density: big number

Keep increasing rock density & box density until it looks right.
B
12
S
3
G
3
Posts: 73
Reputation: 2,647

### Who is online

Users browsing this forum: Exabot [Bot] and 3 guests