Brackeys / MultiplayerFPS-Tutorial

A video series on making a multiplayer first-person shooter in Unity.
The Unlicense
657 stars 287 forks source link

Episode 11 WeaponCamera Issues. #22

Open IpanTheWrongWay opened 6 years ago

IpanTheWrongWay commented 6 years ago

My WeaponCamera is not getting disabled. When I press play (with a player prefab already in the level) I see the prefabs weapon through walls, and it floats around the prefab it isn't attached. I get the same result from when I build the game. I have the WeaponCamera attached to the Player Setup scrips to disable. Any ideas?

The first image shows the camera is attached to the script (I am at 6 instead of 7 because I do not have the animation from moving the character, I plan on changing from a sphere to player model later). camissue

The second image demonstrates what I see when I play (with player prefab or a building game). playissue

the third image demonstrates the player weapon being shown through the wall. throughwalls

All of this leads to me to believe the WeaponCamera is not being disabled properly, I was thinking it had something to do with its layer, but after rewatching the video he never changed the WeaponCameras layer.

cesarchamorro commented 6 years ago

Hey man, I'm so sorry you're having this issue,

Reading the information and watching the images, what i can recommend you is check the layers and also the culling mask in cameras, because you want that of them can be draw by camera, so you will have to check the layers you want to draw with camera one and what you want to draw with the second one.

Let me know the result, see you later.