My gun goes through the walls I have a game object box with a mesh collider on it bit it. It did not fix my problem. Could somebody tell me to add a collider that is something other than a mesh collider or box collider
Thanks
My gun goes through the walls I have a game object box with a mesh collider on it bit it. It did not fix my problem. Could somebody tell me to add a collider that is something other than a mesh collider or box collider
Thanks
The following was part of an answer I made to address another question.
I'll put in that last bit because it's a sweet trick to know.
This will have the gun still visible even though it passes though walls and objects.
This is a pretty neat trick to finding the center of your screen, and thus moving your crosshair to the right place.
I hope this was helpful! :D
Please search for this next time you have this problem. It has been answered many times before.
Put your gun in a separate layer than everything else. Create a second camera that has its culling mask set to only draw that layer and have the clear flags to depth only.
Then have your main camera underneath it.
And there you have it. You gun will always be drawn on top of everything else.
Add a new camera, put it in the same position as the main camera, and make it a child of the main camera, so it always looks in the same direction.
Select your gun, add a new layer called (“Gun”) or anything you wanna name it. Then with your gun selected, change it to that new layer.
Go to the new camera’s properties, and under Culling Mask options, first, select “None” to clear. Then again, under Culling Mask Options, select “Gun”, or whatever you named your layer.
Under Clear Flags, select “Depth Only”
Now for Depth, set to “1”.
Set the near clip plane to 0.01, and far to 5, or however far out your gun’s object goes.
Now your gun should not go through walls or any other objects. Any problems, email me and I will do this step by step with you to make sure you get it working
Clunk47@Gmail.com
I always just added a collider on to the gun... It's always worked for me...
And Yes, please www.google.com your answers, also, here's a custom search for Unity with Google...
http://www.google.com/cse/m?cx=002470491425767499270:iugs1ezlsfq&cref=&theme=DEFAULT
All the best.
hey zylay i have add a layer in the upperright next to layout i think thats what you mean. end i have get my gun in to this layer i have setup a new camera but my weapon stilll goes treu everyting is thare a way that i can do this with more explained i know what your trying to tell me bud i dont know unity so well am djust a starter 3ds max is my ground but tanks for your time anyway