How to pull a crate / box ?

Get help using Construct 2

Post » Wed Dec 03, 2014 1:50 pm

Hi all,

I'm basically trying to pull a crate in the platformer protoype I'm making.
I managed to push the crate from left and right using the platformer behaviour, but can't manage to get the crate follow the character when pulling. Actually I did manage to pull it but then the crate at some point overlapped with the player, which got stuck inside. That's why I should probably not use the platformer behaviour, but I'm not sure how to actually do it differently.

To detect when the avatar should be pulling / pushing the crate, I have put a rectangle that is perpendicular to the avatar. When it overlaps with the crate, and the player presses B on the gamepad, it will pull or push the crate depending on the direction of the stick.

Any help would be gretaly appreciated!

Cheers,
B
12
S
2
Posts: 85
Reputation: 899

Post » Wed Dec 03, 2014 3:46 pm

you can use the PIN behavior (only position) .... for example when (your trigger)... pin crate to player..... when (your end trigger) crate>>unpin
Image
B
58
S
13
G
6
Posts: 271
Reputation: 12,128

Post » Wed Dec 03, 2014 4:50 pm

This need more work but, shows one option. Other thing would be that when pushing or pulling you would control the crate and move player relative to it.

Of course a lot of it depends from your control setup.
You do not have the required permissions to view the files attached to this post.
B
34
S
9
G
3
Posts: 517
Reputation: 5,226

Post » Thu Dec 04, 2014 12:51 am

Thanks a lot both of you!

I used @Katala example to move the crate, that works like a charm. Greatly appreciated the time you put in creating that file!
B
12
S
2
Posts: 85
Reputation: 899


Return to How do I....?

Who is online

Users browsing this forum: Artcadev and 33 guests