Collision while pinned problem

Get help using Construct 2

Post » Fri Jul 20, 2012 11:32 pm

Hi,

When my player object and a rectangular 'container' object are pinned and the 'container' is being pushed into a collision with another container or a wall, they become unpinned and the 'container' is stuck! I have to pin multiple times and press in the opposite direction to unstick it. I was having more trouble with this originally because when the 2 were pinned after the 'container' was stuck, I could re-pin and march the 'container' right through a wall that it was stuck to, aaaahhh. Somehow, applying the 'car movement' behavior without the default controls mended the invisible wall problem (the strangest thing is that the 'car movement' doesn't even seem to be enabled). Anyways, in a perfect world, the 'container' would just stop and not unpin on collision with other solid objects. It should stay pinned until prompted to unpin via the spacebar.

Could someone please help me with this?

Any help is much appreciated!!! Thanks in advance.

I have attached my capx file dropbox link below. I'm having a couple problems with behaviors when objects are pinned to each other.

https://www.dropbox.com/s/x1641u7pxmuzsvx/ThePusher%20Edited.rar?m
B
4
Posts: 18
Reputation: 811

Post » Sat Jul 21, 2012 2:13 pm

When saving your project, select "Save as single file" to get a .capx. You have attached a .rar file of your project files.

The .capx is basically just an archive of your project (like .rar), but we can open it directly in C2 without having to extract the archive and cluttering our folders with a bunch of project files.

Please upload a .capx, and I'll have a look to see if I can help you.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sat Jul 21, 2012 8:32 pm

Hi Nimtrix,

I didn't want to bother you again. You've already done a lot.

I really appreciate it.

Here is my .capx file:

https://www.dropbox.com/s/wptflzvxdpxgk45/The%20Pusher.capx?m

You'll notice, that I tried to solve the problem by having the player spawn a solid object when the containers collide with solid objects, but this is producing a nasty little backwards jump when the solid object spawns. If that worked, I was just going to destroy the spawned object when the player and the container become unpinned, but the nasty jump isn't selling me on my idea..

Thanks again.HighPockets2012-07-21 20:33:52
B
4
Posts: 18
Reputation: 811

Post » Sat Jul 21, 2012 9:44 pm

Oh, I didn't realize it was this game. The only way I can think of is to move the container away from the player when it collides. It's not perfect though:

ThePusher_Edited2.capx (r99)

The pin behaviour might not be the best thing to use for this game as it doesn't really work well with other behaviours. It kind of overrides the other behaviours like solids. Maybe using custom movement or physics to move the boxes would be better, I don't know.

I'm sorry, but I'm out of ideas on this one. Maybe someone else can come up with a better solution.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Jul 22, 2012 3:39 pm

Ok, so I couldn't leave it alone. I made an example of pushing and pulling objects with 8-dir behaviour, and as I thought it's a LOT more reliable than pinning.

TopDown_PushPull.capx (r99)

You can have a go at implementing it yourself. Give me a shout if you encounter any problems.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Mon Jul 23, 2012 9:28 pm

Thanks, I'll take a look
B
4
Posts: 18
Reputation: 811

Post » Mon Jul 23, 2012 9:32 pm

That's great Nimtrix, I'll try implementing it. Thanks a lot!!
B
4
Posts: 18
Reputation: 811


Return to How do I....?

Who is online

Users browsing this forum: qaisarehman and 12 guests