[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: 97
Reputation: 2,712

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.
B
179
S
50
G
208
Posts: 8,724
Reputation: 128,816

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: 97
Reputation: 2,712

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
B
179
S
50
G
208
Posts: 8,724
Reputation: 128,816

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: 97
Reputation: 2,712


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], MrSkailo and 8 guests