Ignoring an already detected collision

Is it possible to detect a collision and then ignore it?

To be more precise, this is something I have always found problems in every single engine I worked with. This is why I always end up using my own custom made engine for 2d games.

Per example, in my most recent puzzle I have pieces that falls using physics, the pieces have different colors and don’t interact with each other unless the user pushes them using wind.
When pieces of the same color (that have been moved by the wind) touch each other they match and starts to descend while also matching any other piece of the same color that they touch.

The point is, they shouldn’t activate pieces of other colors after they are matched, but they must still collide with it.
So I can’t remove collision with the falling pieces, but if they touch the falling pieces they shouldn’t move them away since they aren’t suppose to collide with other colors.

In a perfect world I would like to be able to cancel a collision per piece basis, this mean that if actor X and Y collide I can check for some conditions (like, X have a power-up) and make it a one-sided collision (like X is a unstoppable wall) or simply make both actors ignore each other.

Sorry if I couldn’t be more clear.

Thanks,
Eric.

Hey Eric,

You should be able to do something similar to this in a blueprint, if i am understanding this correctly. You can turn collision on and off, and affect what it does when it does detect collision. If this isn’t what you are looking for perhaps an example of what you are looking for may help?

Best Regards,

Ryan

If you turn off collision you turn it off completely, so how could I know when to turn it off or not? If I put the code on an event collision it’s already too late to turn it off since the collision was already detected.

I think this could be solved by getting an event that is fired when collision is detected but before physics take effect, like PreCollisionDetected, and a function to be able to set the physic interaction between two objects.
14425-
Example: In this game colored balls falls from the top of the screen, you hit the balls with a billiard-like movement, if the ball hits another ball from a different color the ball is deflected and keeps it movement like it hit a wall.
If the ball hits another ball of the same color it does an nonelastic collision and both balls move according to physics.

In current UDK this sort of game wouldn’t be able to use the engine physics since any collision would trigger the physics, detecting the collision and changing the values would bug in the case the ball collides multiple times with different balls. You couldn’t just disable collision because the ball does collide with everything, but in different ways depending of context.
In the end you would have to use a custom movement system.

You could have a bounding volume slightly bigger than the ball in a blueprint and when it over laps with the other it can get the Actor it is overlapped with and from there do what you want. There might be another way as well but that’s just off the top of my head.

Best Regards,

Ryan

That don’t let us use the physics engine, since changing either balls properties would make any ongoing collision strange or mess with another collision in case of a series. Also in case many balls approach only the last one would affect the conclusion.

Hey Eric,

Yeah it sounds like you might need to create a custom actor class to use at this time. We are always updating and adding new things so we may see something in physics or blueprints in the future.

Best Regards,
Ryan

Isn’t a collision filter, like a group filter, would help to sort objects inside specific collision groups ? Like for example the lighting channel we had in UE3 which allowed to light specific surfaces.

This way you could make a specific channel per group of balls and just let them interact with the world. Balls withing the same group collide with each other but ignore the other group of balls. This would also make detection much more easier since you don’t have to filter manually each object colliding see if you have to interact with it or not.

I don’t know PhysX at all but I think something like this should be easy to make natively.

I think what you want is ‘dominance groups’, a feature which lets you have ‘one sided’ physics collision. Does that sound right? This is not currently exposed in UE4, though we may do in the future.

Oh man that sounds exactly right! It would be awesome to have that exposed!
Thanks very much.