Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look Rotation Viewing Vector Is Zero log every update #895

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

neichner
Copy link
Contributor

@neichner neichner commented Aug 20, 2024

In the AngularClamp method there is a bug that causes Quaternion.LookRotation to get Vector3.zero values, which aren't allowed.

For extremely low values, this will cause an issue because Unity's internal Normalize method does the following:

float num = Vector3.Magnitude(this);
if ((double) num > 9.999999747378752E-06)
  this = this / num;
else
  this = Vector3.zero;

This will return a Vector3.zero which will then be put in the Quaternion.LookRotation() method.
This will cause unity to throw the log message: Look Rotation Viewing Vector Is Zero.
Which happens every update and is slightly annoying.

So the fix here is to do the same check with checking the magnitude for that same low value that unity internally does.

Signed-off-by: Niek Eichner <[email protected]>
Signed-off-by: Niek Eichner <[email protected]>
@neichner neichner requested a review from AMollis August 20, 2024 16:25
@keveleigh
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Ali-Can-Keskin
Copy link

I receive the same log spam when I try to run Input Simulation on WebGL builds, while trying to get the hand simulation running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants