- Home /
How do I implement a Collision priority system?,How do I setup a Collision Priority system?
Hey guys, I'm currently struggling with implementing a Collision priority system. For example, I have a Script which checks in OnCollisionEnter what kind of priority the Object has that collided with it. If that object would have a lower priority (e.g an int) it could be pushed. But if it would have a lower priority it couldn't be pushed. And if they have the same priority neither of them could be pushed. The priority would be based on if the object is moving (higher priority) or standing (lower priority). Or both moving resulting in the same priority.
What i tried was first checking the priority of both objects and setting the one who could push the rigidbody to isKinematix = true. So some problems are arising, after setting it to false again the player object started sliding sometimes and the other object as well (through debugging i noticed that the velocity of both objects increased).
Another problem is, that i do not want the objects to be moved through physics (which ist why the player object moves with MovePosition()). How do I push an object with a lower priority without physics? Should i get the direction of their contactpoint and move the object with the lower priority with the method OnCollisionStay?
I would be very happy about some answers!
Your answer
Follow this Question
Related Questions
My Build Platform won't change. 0 Answers
Spherical panorama texture with transparent sky 0 Answers
Jumpscare Need Help 2 Answers
Ads are not showing in my game.Please help me 0 Answers
Bundle Identifier not appear in player setting (Android) 0 Answers