How to Stop Collider from Moving?
Hello Guys I have this really strange problem.
I made a level for my Top Down Shooter game using Polygon Colliders to for the walls so my character doesnt move through the walls. But Once I run the game, If my player hits the Wall, it's collider moves along with the player. I don't have any Rigidbodies on my Wall Colliders but I have a Circle Collider and Rigidbody component on my player (gravity Scale set to Zero since its a 2D Top Down game).
See Attached Photos:
Any Help Would be appreciated! :)
Answer by mkShogun96 · Sep 06, 2016 at 06:51 AM
I solved the problem! There was a rigidbody sitting on one of the colliders that I didn't see. It had gravity and everything so that was the cause of my problem. I removed all rigidbody from all of my colliders and that seems to be the best solution since if a collider doesn't have a rigidbody it is set to be a static collider (which means that it will not move!). So glad I sorted this out but in the process learned a lot though!
Sad to say but I ended up Answering my own Question haha :D
Answer by davidjohn123 · Sep 03, 2016 at 07:37 AM
I have gone through this problem, you need to add box collider manually and add rigidboyd2d and gravity=0;
Thank you @davidjohn123 I was thinking that could work as a solution, but I was afraid that it wouldn't be the best solution performance-wise. Ill give it a try thanks!
Your answer
Follow this Question
Related Questions
OnCollisionEnter 2d not working 0 Answers
Collision detection in 2D 1 Answer
Why/How 2d tower of blocks collapse? 0 Answers