|
Hi all, I want to make a FPS and I have added a gun to the First Person Controller of the standard assets. I don't want the gun passes trough the walls, so I have attached a collider to the gun but it does not work. I have found a similar post but I don't understand how to apply the solution, http://answers.unity3d.com/questions/9168/why-wont-my-box-collider-collide Thanks!
(comments are locked)
|
|
For guns, there is a better way to do it. Add a second camera on top of your main camera that moves around with it. Then:
Now your gun will always be drawn on top of everything else so you don't have to worry about it clipping through the environment. Thanks! I will try this option
Dec 12 '10 at 11:44 PM
wall
I have tried it and it works great. Nevertheless i still don't understand why the collider option does not ok. Thank you very much Peter!!!
Dec 18 '10 at 09:29 PM
wall
It has to do with how Unity calculates physics. If you use CharacterController.Move, Unity does not calculate collisions for colliders in its children. You could try adding a rigidbody to your child collider, but I don't believe it would make any difference.
Dec 19 '10 at 07:07 PM
Peter G
(comments are locked)
|
