Combat Polishing

I had already broken out the is target NOT visible into a method, but when I changed it to use the renderer:

    private static bool IsTargetNotVisible(Target target)
    {
        var value = target.GetComponentInChildren<Renderer>();
        return (!value.isVisible);
    }

It always returns true. I put a break point on the return and the value is the body renderer and it says isVisible is true. What could be causing this? The enemy is not even close to being on the camera.

Hmmm… it’s possible that it is visible on one of the inactive cameras…

From the Unity Docs:

Note: that the object is considered visible when it needs to be rendered in the Scene. For example, it might not actually be visible by any camera but still need to be rendered for shadows. When running in the editor, the Scene view cameras will also cause this value to be true.

Try pointing your scene view into the sky.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms