This is to make so that in a first person shooter game, the user controlling his own player character won’t actually see his own character model, but he can see his friend’s player characters and vice versa.
Although I’ve seen people put the player character’s camera slightly in front of the 3d model, I would like to how say CSGO does it because I think CSGO and other FPS games simply have their cameras inside the player model.
Also how would one also implement full body awareness (Look down see your legs)while using this system?
Yeah, check if the player is the local player and hide the model if not.
An easy solution would be to give your player a model which only includes the parts of the body you want to be able to see. This is probably the way most games do it (correct me if I’m wrong).
If your game is an online game, you should choose the appropriate mesh for the player you are spawning (Mesh with only arms if the player is the local player; Mesh with entire body if the player is some other client).
This is how I would do it, but there are certainly different solutions, I hope I could help
This is just a small sample of my work regarding parkour mechanics in FPS with full body awareness.
Contact me if you need some help: email@example.com.
to solve this issue a trick of layer masking is used.
- change layer name of guns and hand to something like “PlayerCanOnlySeeThis”. Do not select the legs as you don’t want to see your own legs.
- Add a camera to the position and in the inspector change the clear flags to “Depth only” and culling mask to “PlayerCanOnlySeeThis”, and Depth to 50. (What this will do is render only the objects with this layer on top of the main camera)
- Use another camera in that same position so see the world and under the culling mask deselect the “PlayerCanOnlySeeThis”.