- Home /
Blocking object from going through colliders (no rigidbody) [2D]
I'm making a 2D game, where players fight with tanks and need to block them from going through walls. I tried adding RigidBody2D, but it has other effects on the tank movement that i do not want. Is it possible to use a RigidBody2D only for blocking move through colliders or to use something else to solve this?
Answer by oscarlundberg · Jun 12, 2017 at 09:07 AM
What effects of the rigidbody do you not want?
You can change many settings on the rigidbody, such as 'is Kinematic', 'freeze position' and 'use gravity'. If none of those work you can try removing the rigidbody and just using a box collider instead. Make sure that 'is trigger' is NOT checked on the collider, otherwise it wont collide.
Hope this answers your question
Your answer
Follow this Question
Related Questions
How to shatter 2d objects without rigidbody? 1 Answer
Rigidbody collision movement similar to a wall 0 Answers
Avoiding 2D top-down diagonal movement 2 Answers
Collider2D.GetContacts(List() contacts) works with OnColliderEnter2D but not with OnTriggerEnter2D 1 Answer
2d rigidbody falling from the collider when it is moved 3 Answers