Physics pivot chain

Get help using Construct 2

Post » Tue Sep 25, 2012 5:57 am

I'm trying to link this red object to the green wall with gray chains using physics behaviour (with pivots).

I can't get it to work at all.





chained.capx


The result for me:

alspal2012-09-25 06:01:13
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Tue Sep 25, 2012 6:27 am

I didn't take a look at your capx but here is a example that you can compare against:
http://www.scirra.com/forum/a-rope-on-a-roller_topic49497_post311730.html#311730
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Tue Sep 25, 2012 6:56 am

@R0J0hound, Yeah I've based my understanding for this from that, but its not working which is why I need help.
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Tue Sep 25, 2012 2:21 pm

Firstly, it may not be id'ing them correctly from left to right..
if you leave "order by: " blank, then I assume it will pick them based on the order they were created within the layout editor.
so either make a system that creates the chain objects on startup inbetween 'Red' and 'wall', or for now you can simply do "order by chain.x ascending", this will pick them from left to right.. (so bare in mind that this wont work if you want the chain to go in other directions)

next there are some picking problems with chain and link..

Im not sure if you just followed example, or you figured out for yourself, but the reason it's good to use a family here is to help make it clear what instances your action is referring to.
For example having "chain: create joint to chain" will make it confused as to what chains to pick
but having "chain: create joint to link" means that, in the conditions, you can specify what chain, and specify what link. Even though a link is just a chain, it allows you to pick two seperate chains. It's awkward, yes :)

so anyway..
link: id ? 3
should be
chain: id ? 3

and for the last two events you just need to be consistent with whether your choosing link or chain.
the "link:id=0" event i think is fine, but the "link:id=3" event then goes on to refer to a chain instead.

for simplicity and ease of reading the sheet i'd replace all occurences of 'link' in those last two events with 'chain' instead
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Tue Sep 25, 2012 6:02 pm

Your events should look like this:
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Thu Sep 27, 2012 1:48 am

Thanks guys. I feel so stupid now, such basic mistakes!
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Thu Sep 27, 2012 12:48 pm

Just realised, if you use:
'For each chain order by distance(chain.x,chain.y,red.x,red.y) ascending'
then it will order the chains going from red, regardless of direction.. so you can have it going up right down etc.keepee2012-09-27 12:48:39
B
28
S
8
G
1
Posts: 469
Reputation: 4,683


Return to How do I....?

Who is online

Users browsing this forum: Braus, Yura G and 12 guests