This is a strange one, but very annoying. If anyone’s willing to help, they may end up having to go through my project to try and find the cause. Anyway, while I was working on an FPS game, I started making the weapon animations and now all of a sudden, the player’s mesh does not render at all until one of two things happen:
A certain amount of look input happens, that forces the mesh to render
The debug camera is used to jump out of the player, and force their mesh to render
This all started after I assigned the pistol animations I’d created to the player’s anim BP, and also created a basic “unarmed” animation to use until the player picks up a weapon. I’ve been (figuratively) banging my head against a wall for days now, trying to figure out how to fix this. I’m using UE 5.2.1. Here is a video I recorded of the issue:
It happens both in the editor and in packaged builds, but is much more noticeable in the editor. Something else that might be worth pointing out is, the nodes in the anim BP used to have a red execution flow after compiling, but they stopped around the same time that this issue first occurred. Not sure if the two are connected.
Investigating things a bit further, I’m finding that the game just refuses to render the player’s mesh without it being clearly in view. Here’s a screenshot of the player BP, as well as what the unarmed animation looks like:
So if I move the mesh right up in front of the camera, then it’ll render just fine. In addition, I’ve got a control rig in the level that I’ve been using to create animations. Since the control rig is for this same mesh, the player’s arms will render when the control rig asset is in camera view.
Short of creating a new unarmed animation that has the hands up in front of the camera or something, I’m not sure how I should go about fixing this. I feel like there has to be some sort of setting or function that can force this mesh to be rendered, but I haven’t been able to find anything like that.
This’ll likely be my final response for now. After fiddling with a bunch of random settings, I’ve managed a workaround by setting Use Attach Parent Bound on the player mesh to true by default, and then setting it to false once the player picks up a weapon.
If Use Attach Parent Bound is still true after the player gets a weapon, then the rendering on their arms and weapon becomes severely distorted. But right now I don’t have any visible animations when the player’s unarmed, so having that setting start on true will keep their mesh “rendered” until a weapon is picked up, at which point the rendering will start working like it should.
If anyone has a more “proper” solution for me to use, I’m very much open to it.
I feel like the camera shouldn’t be culling things that it’s attached to, in situations like this. And I think that adding another camera just for this might be a bit much, especially since my workaround hasn’t presented any drawbacks that I know of. That could certainly change as I get further into the project, but here’s hoping it doesn’t
I’ll try to read up a bit on Unreal’s culling; this documentation page has been pretty informative. Thanks for the suggestion!