Forum rules - please read before posting.

Character disappearing during camera change

Hello! So I feel like I'm missing something obvious. I have a specific camera movement where the camera pans up from looking at my character to look at the sky. However, the character disappears mid-way through the movement.

Here is a quick video of the problem:

I thought that the camera was clipping through the character, but all I am doing is changing the Y position of the camera, so the camera shouldn't theoretically be any closer and should therefore not clip? I've tried moving the camera further away from the character before moving it, but the same thing happens. Regardless of how far away the camera is from the character, the character disappears about halfway through the camera change.

All the cameras are regular default simplecameras, with no processing added.

I have no idea why this could be happening. Any light-shedding is appreciated!

-Dave

Comments

  • edited June 14

    Hiya Dave!
    Since it looks like the character disappears when the bottom of the camera view reaches the midpoint of the character, I'd say this is not a clipping issue but a culling issue. The camera is attempting to hide an asset that it thinks is offscreen. (This is just a guess.) Try playing around with the culling options in your camera properties and see if that affects anything.

    Also, welcome to the group!

  • Hmmm. The culling mask is set to "everything" for all the cameras involved, so I'm not sure what the issue is there. I will fiddle. Thanks!

  • OK so I did some digging and uncovered more info.

    To debug this problem easier, I set the game to start at at this roof scene...and the problem magically disappeared! But I then set the game to start from the beginning and the problem returned. So the problem obviously stems from something I did at the beginning of the game.

    After a lot of trial and error, I discovered that if I removed one animation call at the beginning of the game, my character does NOT disappear on the roof later. This is good! I figured out the cause, but I still have no idea why this happens. How could an animation call cause the character to be culled/clipped later?

    This is what the animation looks like in the inspector, if that helps:

    Any light shedding is very appreciated. This bug has been driving me nuts.

  • edited June 15

    For the record, this wouldn't be an AC issue - just a general Unity one. You may also be able to get some advice on the Unity forums.

    Your video shows the issue in the Editor - does this also occur in builds? In my experience, there can be times when there is such a difference between Editor and builds - but keeping the Scene window in another tab seems to mitigate this.. for some reason.

    @PinheadGames is right, this is a culling issue, whereby the camera believes the character is off-screen. Unity determines this by reading the model's bounding box - which is set in the character's Skinned Mesh Renderer component. Check these values to see if they correctly cover the character.

    Another option is to check this component's Update When Offscreen field, and/or set the Animator component's Culling Mode to Always Animate. You should check Unity's documentation for these fields, but at least one of these should prevent the character from being culled in the first place.

  • Aha! OK I think I got it figured out.

    I use UMA for my characters, which generate the characters at runtime.

    At the beginning of the game, the character is lying down. She stands up and the game begins.

    What appears to be happening is that UMA created a bounding box for the lying down position, because that is the position she was in when the UMA was created.

    I changed it so that the game starts off with the character standing up, and then changes her to the lying down position a second later. You don't see the character for at least ten seconds after the game starts, so it's fine.

    So the problem obviously lies with UMA. I found a workaround, but I will speak to them about it. Thanks for the help!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.
Do NOT follow this link or you will be banned from the site!