How to continue with current force and direction after collision.

Hi All,

I have a physics problem I’ve not been able to figure out or find a prior thread.

During the course of my game, I may have a power-up where it would allow one game object (ball) to continue on its current trajectory and force after having collided with another game object (wall). In other words, no bounce. The wall would be destroyed (removed) of course. I still need to detect when the collision occurs–but just need to be able to override the normal bounce behavior when I have this power up.

I’ve tried using the Physics.IgnoreCollision method but apparently inside the event OnCollisionEnter function – it is too late to affect the outcome.

Any suggestions?

Regards,
Manny

I would just make the wall a trigger

Thanks! That did the trick.

And if I understand correctly, that means at run time I just need to set my game objects of a certain tag to “isTrigger” for when I need this. Correct?

Any ideas on what the performance implications might be if I set the “isTrigger” property for several hundred game objects (100 - 300) at a time?

Regards.

Yeah there are alot of ways you could do this. Tags would be a simple way without needing to script. Or you could just set them in the inspector if you want. Also remember if its a trigger that everything will go through it, so if there are some things you want to go through and some to not go through you will need to take that into account.

And Im pretty sure Triggers are actually faster than Colliders, but im not 100% sure on that.