build a physics chain from objects

Get help using Construct 2

Post » Tue Jun 12, 2012 11:32 am

Hi,

I would like to connect 5 or more objects of the same object type (e.g Sprite: "chain_link") via revolute-joint in the right Order.

How would i do this? It would be very simple if i could choose the joint object by expression, but since i can only choose from object type. Im not sure how you would to it.

I'm working with Construct2 for a while now, but this problem still
gives me some headache.

I Hope you can help me.Fabian Schempp2012-06-12 11:32:47
B
18
S
3
G
3
Posts: 29
Reputation: 2,724

Post » Tue Jun 12, 2012 5:12 pm

B
79
S
24
G
54
Posts: 4,740
Reputation: 40,743

Post » Tue Jun 12, 2012 5:59 pm

Thank you!
B
18
S
3
G
3
Posts: 29
Reputation: 2,724

Post » Sun Jun 17, 2012 10:34 pm

@R0J0hound
Your example is exactly what i was looking for.
However, i tried to copy it and modyfied it a bit for generatig a number of seperated chains with variable length.
The Programm is still simple and if i set the chain links Physik behaviour to immoveble they are generated in the right place with right orientation.
But if I enable Physics, They EXPLODE.
Here is the extracted capx file.
I tryed different configurations of the physics behaviour and different joint types but it always explodes. What could be my mistake?Fabian Schempp2012-06-17 22:35:25
B
18
S
3
G
3
Posts: 29
Reputation: 2,724

Post » Sun Jun 17, 2012 11:34 pm

The first thing that is causing the explosion is creating the chain_link at 0,0 then immediately setting the position. If you condense it into one create action it will fix that. It seems to take a tick for the physics behavior to account for repositioning.

The second problem that comes up is the links all end up being horizontal in spite of setting the angle. This is the same quirk as with position. A fix would be to make the chain over several ticks.
* "Start of layout" create the links
* "tickcount = 0" create joints between links
B
79
S
24
G
54
Posts: 4,740
Reputation: 40,743

Post » Mon Jun 18, 2012 9:08 am

@R0J0hound
Thank you very much for your quick and helpfull response.
I will try it this way.
B
18
S
3
G
3
Posts: 29
Reputation: 2,724


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], R0J0hound, randomly, Zakeru and 19 guests