0 votes

In first person mode, I want a tool to be visible as though the player is holding it as in first-person shooters or Minecraft. However I want this to be a different mesh than another person would see the player holding. Howe can I do this?

Can I use layers, like in 2D? Is there a similar thing for 3D?

in Engine by (56 points)

You can toggle the visibility of meshes when you "switch" the camera from FPV to other perspectives/players.

Aside from this I only know of the Range Begin/End Values in Meshes which auto toggle visibility dependent on the distance to the camera (usually used for LOD).

Maybe you can make it so your mesh is always drawn on top, I remember there is a way to do it with materials but I don't know which setting it is

1 Answer

+2 votes
Best answer

In Godot 3.0 there is a hack to draw first-person meshes, which is to have the model next to your camera and check no depth test in its material. This will draw the mesh on top of everything else, however it's limited to a single mesh.
In 3.1 there is a plan to add render layers, so you could render anything in a separate layer to have it on top (from Reduz on IRC).

For other players, if your game is multiplayer I guess you can simply not instance the same one, since you certainly know which player is you and which player is not you.

by (28,735 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.