Here’s a link to the video that is giving me this problem:
http://www.youtube.com/watch?v=_YhahZPE9Mg&list=PL7AE076AFAFD3C305&index=9&feature=plpp_video
At 15:15 in that video (FPS1.9 Aiming) you can see the gun moves to the center of the screen very nicely when holding down right click. In my game, the gun does go to the center of the screen, but the gun is too close to the camera and gets cut off. It looks really bad.
I have my gun model on a separate game object as the game object with the gun script attached to it. The gun model is a child of the game object with the gun script attached to it. The gun script moves the x and y position of the gun (the parent) to the center of the screen when I hold down right click. That part works fine, but how do i move the gun forward or stop it from going through the screen?
Any help would be very appreciated. Thanks in advanced!
Hey ETeeski,
I was having the same problem last week. There are two ways to fix this.
First, change the local Z position of the gun model object(s). Just select all the children and increase the z position in the inspector. It’s usually easier to do it in the inspector because if you move them on the wrong axis, you might just mess it up more.
Second, change the near clip plane on the main camera. Just select your main camera object, and in the camera component, change the near clip plane to the smallest number it will accept. I think 0.001 is the smallest it will go. If you have a gun camera, or a camera with a culling mask for guns, make sure you change the near clip plane on that as well.
Hey that worked! Thanks ETeeski!
Lol, I just realized this thread may be very confusing to anyone not knowing what I’m doing. This is supposed to be an example of a thread system I’m trying to set up for my tutorials on youtube.
If anyone is interested in how this is all supposed to work, check out this thread here: ETeeskiTutorials FPS1 Problem Diagnostic Collaboration Thread