Forum rules - please read before posting.

1.57 - "Look rotation viewing vector is zero"

edited February 2022 in Technical Q&A

Hi there!
I just upgraded to from 1.74.5 to 1.57 and ran my automated playthrough of my game. Everything worked, but the console and log file is now showing (hundreds of) entries of this message:
"Look rotation viewing vector is zero"

It's not one of your messages, but something in 1.57 is triggering it. It looks like you could get around them quite easily:
https://forum.unity.com/threads/simple-fix-for-look-rotation-viewing-vector-is-zero.411731/

Thanks!

I'm on Unity: 2021.2.9

Comments

  • Can you share the error message in full?

  • It's not an error, its just hundreds of those exact messages being logged. Check out the link for an example of how to create one.

  • Error or not, I need to know the source of it - which I can only glean from the full message in the Console.

    If it's related to a character, please also share details of their Inspector.

  • edited February 2022

    There is no stack trace or any other text associated with these log messages.

    As for the source, you're gonna have to google it or look at the link. But on Unity 2021.2.9 (on win), I just need to play (on any scene), and it's the first thing that is written to the console.

  • I've looked at the link, naturally. But I cannot tell where its coming from without knowing more from your end of things.

  • I looked at all your calls to Quaternion.LookRotation and found that adding the if-statement from the link here got rid of all the messages 👍

    Line 3972 in Char.cs:

    public Quaternion GetTargetRotation ()
    {
        if (lookDirection == Vector3.zero)
            return new Quaternion();
    
        return Quaternion.LookRotation (lookDirection, Vector3.up);
    }
    
  • I'm seeing the same log.
    It's happening inside AC.Char.GetTargetRotation when lookDirection equals Vector3.zero.
    It's triggered by Unity's Quaternion.LookRotation.
    To me it happens only once, on the very first call when the game begins.

  • Thanks for the details.

    @Keks - does kloot's above fix resolve it for you as well?

  • I didn't notice kloot's message before as he posted right before me.

    @ChrisIceBox Yes, it does. kloot's fix removes the log messages.

  • Also seeing this after updating to AC 1.75 as warnings in the console when a scene is loaded (or Player spawned):
    https://imgur.com/a/mtU45PR

    The game is 2D using Sprites Unity Complex, and using Unity 2021.1.28f1.

    Currently wondering if this will be addressed in a future AC update, or if the fix above should attempted to be applied.

    It doesn't appear to be affecting anything big, though it would be ideal if the warning didn't appear in the console.

    Thank you.

  • Currently wondering if this will be addressed in a future AC update, or if the fix above should attempted to be applied.

    Both - it will be addressed in the next update, but the above can be applied to remove the messages in the meantime.

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.