CustomMovement Family collision problem

For questions about using Classic.

Post » Tue Apr 10, 2012 3:36 pm

I have a player-controlled Object and a Family of colliders. I need the Object to pass through some Family Members, while sliding around others, the behaviour being chosen using a Private Varable/comparison condition.

No matter what I do, I'm unable to bounce/slide my object off only select Family members - all the members are always taken as a collider. I have:

On Object Overlaps Family Member
Family Member PV is greater than SomeNumber
->Object bounce off Family Member

Now the issue happens when the Object is already overlaping a Family Member that fails the comparison and comes into contact with another that passes it - the failed member is still used as a collider for the bounce.

How could I rectify this? Any help would be appreciated.
B
8
S
2
G
2
Posts: 85
Reputation: 1,218

Post » Tue Apr 10, 2012 8:24 pm

Have you tried adding loop for each Family Member on top of all that?
And if that doesn't work you could try on collision with family member instead of overlaps family member.
B
6
S
1
G
1
Posts: 69
Reputation: 1,019

Post » Tue Apr 10, 2012 11:25 pm

I have, but it does not seem to make a difference.
Here's where I managed to get to. The collisions work as I want them to, except when the Player_Tile overlaps a tile that fails the comparison test while colliding with one that passes it. Left and Right arrow keys rotate the Player_Tile. Up, Down to move forward/reverse.

Thanks.

http://www.sendspace.com/file/u136ti
B
8
S
2
G
2
Posts: 85
Reputation: 1,218

Post » Thu Apr 12, 2012 3:14 pm

Aha it seems something is wrong with the bounce action.It picks all instances of the sprite instead of one.
Here: http://dl.dropbox.com/u/52670878/bounce%20bugfix.cap
The best workaround i can think of.Let me know if you can't figure out how it works.
B
6
S
1
G
1
Posts: 69
Reputation: 1,019

Post » Thu Apr 12, 2012 7:16 pm

Thank you for the continuing assistance.

I see... You're using a rounded off angle from the Rectangle_Tile pivot to the Player_Tile to shift it back... This works, but the more the tile becomes stretched, the more that shift will become, leading to problems.

In the interim, I had come up with something which similarly avoids making use of the Rectangle_Tile data - basically, Player_Tile.XY is recorded to a PV at every tick and as soon as a collision is detected, Player_Tile is shifted back to the last recorded position, which is always a tick before the overlap.
This is fullproof in terms of collision testing, but I lose your wall sliding effect, which is what I'm after as well...

After seeing your file, I seem to have achieved a solution that fully satisfies all my requirements. The pre-requisite is knowing which condition/actions pick which objects ... Based on my testing:

Conditions - Sprite - Is Overlapping and On Colision always picks only the pair of objects that are currently colliding.

Conditions - System - Collision/Overlap conditions always pick all the object instances that collide in the whole cycle/tick

Actions - CustomMovement Bounce always picks all the object instances that collide in the whole cycle/tick.

So, what I did was to create a Collision_Tile that gets positioned exactly over the Rectangle_Tile once a Rectangle_Tile Overlaps With condition is passed. Then, Player_Tile is bounced off the Collision_Tile with 0 friction, which positions it right outside the collision mask, preserving the sliding motion.

Sorry for the wall of text. Here's a modified .cap which illustrates all the above. Thanks again for your help.

http://www.sendspace.com/file/kdx70uFunky Koval2012-04-12 19:17:28
B
8
S
2
G
2
Posts: 85
Reputation: 1,218


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests