[solved] How do I chain the player to the ground?

Get help using Construct 2

Post » Sat Dec 06, 2014 3:09 pm

For a part of my game, my player is held captive by chains until he breaks out. I need to be able to root the player to the ground.
Right now, I followed the Pin Chain Style example in the Examples folder that comes with Construct, and the chain itself attaches correctly to the player, but will not stay rooted to the ground. How can I keep the chain held to the ground without moving?

Thank you!
Last edited by MadameBerry on Sat Dec 06, 2014 8:19 pm, edited 1 time in total.
B
19
S
5
G
1
Posts: 96
Reputation: 2,710

Post » Sat Dec 06, 2014 4:34 pm

Well it depends on the way you are moving things, but clamp(min, max) would be a start.
Image ImageImage
B
169
S
50
G
174
Posts: 8,322
Reputation: 110,788

Post » Sat Dec 06, 2014 6:37 pm

The player is moved using the Platform behavior.
I'll give that a try, though I'm not sure the best way to implement it.
B
19
S
5
G
1
Posts: 96
Reputation: 2,710

Post » Sat Dec 06, 2014 7:02 pm

You could try distance(player.x,player.y, yourchainanchor.x,yourchainanchor.y)> thelengthofthechain, set vector x=0 set vector y=0
Image ImageImage
B
169
S
50
G
174
Posts: 8,322
Reputation: 110,788

Post » Sat Dec 06, 2014 8:19 pm

That seems to work. Thanks!

I handled the appearance of the chains with physics objects and joints. They're super bouncy but that's the best I got.
B
19
S
5
G
1
Posts: 96
Reputation: 2,710


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests