I have a playermodel with animations I just added in my game, but it's a first person game, I want the player to be able to see their model through mirrors (which I have), reflections and stuff like that, but all I can see is the inside of my players head, I want to hide the entire model from the camera but not for everything else, is this possible?
#Player model visible from camera
1 messages · Page 1 of 1 (latest)
I sent this in quick help but everyone was ignoring me, it happens everytime I try to ask for help, I always send the message more than once and still no ones responds
what the player sees
what the player should see
i'm not as experienced with gamedev so i'm not sure if this is the proper solution, but maybe you could experiment with raycasts? the do have a property for hitting something from the inside if i'm not mistaken so that could possibly be helpful
it depends on how you setted up mirrors, maybe you can use cull mask layers and set it up so that player layer is not rendered through player camera
How have you set up your mirrors?
well honestly it's not really about the mirrors that much, in minecraft first person you only see your viewmodel, not your player model, other people see your player model though, your model also casts shadows even though you can't see it, that's what I want, I probably didn't explain it that well the first time
is your camera inside the player's head?
simple way is to set the cull mode to back, that should take care of most of it
if that doesn't do it though then yes it depends on the mirror implementation. there are camera layers you can use to hide specific things from specific cameras. just disable the layer on the camera and it won't see that mesh. but that might also lead to the mirror image disappearing, depending on how you did it
you can also play with the camera's near plane to just not render any meshes that are very close, but that could also hide a wall if the player bumps their head into it. depends how the rest of the scene is set up
similarly you can also play with the visibility range begin to hide the player mesh if it's too close to the camera
@lapis crystal all of these hide the mesh completely, I want the player to still be able to see shadows and stuff like that
thanks though
shadows of the player mesh? just dupe the mesh and set it to shadow only
also they don't hide it completely, both near plane and visibility range still let you see the mesh from further away
curious how this solution would affect the performance
isn't it doubling the amount of triangles for every mesh? or does it work differently when it's set to "shadow only" 🤔
Technically yeah. Does your model have a lot of tris
not sure what is considered many
about how many does it need to be to affect the performance if duplicated?
Depends on the game, check the profiler in the debugger at the bottom and see if there are drastic changes if you enable the shadows mesh
yeah! though still kinda curious what is considered the "average" amount for small/normal/graphics heavy games if you have any idea
if I dupe it I still have the issue of not being able to see because the mesh is in the way