- Home /
Collisions on gun affect players movement
I have a box to take the place for a gun attached to a First Person Controller Prefab's main camera. Everything is fine until I start to move. It looks like there is a lot of resistance keeping it from moving in specific directions.
It really shows when you look down, and/or aim down the sight.
Answer by roamcel · Jul 03, 2012 at 07:08 AM
Hi and welcome to Unity answers.
Make sure that the collider in the weapon is set to a different layer than the character controller's. Otherwise, the two physical objects will push each other away when they intersect!
Select the gun, on top of the Inspector menu right under the name is the tag and layer setting. And you will probably have to change the physic settings (Edit->Project Settings->Physics) so that the player and the gunlayer can't collide with eachother.
Thank you so much guys! I've had this problem since I started using Unity, and got annoyed so much I finally asked this question. I never heard about layers before, except in Photoshop. I'll need to check them out.
Please mark the answer as accepted so that the question is closed, and others searching for the problem can easily access the solution.
Your answer
Follow this Question
Related Questions
First Person Controller 1 Answer
C# How to have weapon pickup 1 Answer
Gun Ammo help in JS 1 Answer
Bullets going wrong direction 1 Answer