Weight in Physics

Get help using Construct 2

Post » 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
17
S
4
G
5
Posts: 226
Reputation: 4,042

Post » 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
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » 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
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » 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
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » 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
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Mon Jan 16, 2012 3:06 pm

I second Animmaniac's idea!
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » 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

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » 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
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » 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


Return to How do I....?

Who is online

Users browsing this forum: Kagubro, Mirlas and 24 guests