How to make Character model hidden?

So how can I make the character’s model hidden when a button is pressed, but still cast a shadow?

Or even better, how can I just make the head part of the character model hidden when a button is presses, but still cast a shadow.


Hey Knovolt,

In your Player Controller (or wherever you are receiving input for your character), you can use the Set Hidden in Game node to toggle whether a Component is hidden during play. You could set up something like this:

This will Cast to the character Blueprint, get the component you want (in your case, your Head mesh), and set it Hidden. I’m using a Bool variable (default value as false) and setting its negative every time, so while H is pressed the mesh is hidden, and when H is released it becomes visible again.

You can decide whether an Actor or Component casts a shadow while Hidden. In this case, I found the mesh component of my character’s Blueprint and scrolled down to Lighting in the Details panel. If you expand that section, you’ll find Cast Hidden Shadow. Enable that, and a shadow will be cast whether it is hidden in the game or not.


Hope that helps!

Ben Halliday

Thanks. But, when I hit play and press my designated key, it works and all but after a while the shadow stops animating. It still casts the shadow but soon after it stops animating and freezes.

And when I press the “S” key to turn walk backwards, the shadow turns around, but the camera doesn’t.

(Note: the aforementioned issues happen even when I uncheck the “Visible” box in “MyCharacter” defaults.)

And how do I just link it to the head, I still want my hands for example to be visible. Could this be that I didn’t have mesh as target? I couldn’t seem to get it up…

Here’s the blueprint I got so far.
I’m so very stuck with this, thank you.

Hm, I’m seeing the same thing with the shadows pausing after a bit. I’ll enter a bug report for that and see what the developers say.

It looks like you’re setting this up in your Character Blueprint, so you can skip the Casting step. In the image above, you’re casting to yourself, which is unnecessary. Instead, just call the Hidden in Game node directly off the mesh you want to hide. If you only want to hide a certain portion of the mesh, you’ll need to have the mesh split into several components. If you look at the FPS template, you can see how this is done: there is a mesh for the full body and a separate mesh for just the arms. There is also a checkbox in the Rendering section of a mesh component’s details for Owner No See; this is how hiding the mesh from the player is handled in multiplayer games.

Is that what you’re attempting to do here? To switch from a third person to a first person perspective? I’m not exactly clear on what issue you’re running into when you press S, or how you have your camera set up.

Okay, I’ll go look at the FPS template and see how it works. But what do I type to search for the “target mesh”.

And yeah, I’m trying to do a fp to tp perspective, but the head either clips into the camera or I can see the entire head/neck when I run. But, now the shadow seems to be working fine? Maybe I had to exit/relaunch the editor?

By pressing “S”, the shadow turns around and faces backwards, but the camera does not change (in first person). Shown here:

I tried having a angle limit on the yaw, and it works nice, but when I press “S” it spins the camera around abruptly. So when holding down “S” the camera spins in circles because the blueprint makes the camera spin when it goes pass the limits.

In your video you are no longer hiding the mesh, so that’s why the shadow isn’t showing that bug.

You might want to open a new thread on the forums or here on AnswerHub for how to switch from third to first person and back, as there are a number of possibilities there and I’m sure the community has some answers for you. The problem you have with S turning your character around is that the controls are still set for third person, in which the character can run towards the camera rather than run backwards. You’ll need to switch to a control setup more suitable for a first person perspective.

You might consider setting up a second Player Controller Class with controls similar to those you can find in the First Person template. Then you can cast to your Game Mode and set the Player Controller Class when appropriate.

Hope that helps!

In 4.9 animation still stops when a character’s visibility is turned off or when it is set as hidden in the game. Is it intended or a bug?

Hi Nox,

Please open a new post in the Bug Reports section with as many details as you can provide and we can look into it there. Thanks!