Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[C#] Vector3 normalized returning zero

Discussion in 'Scripting' started by MordazaH, Jul 26, 2016.

  1. MordazaH

    MordazaH

    Joined:
    Oct 15, 2015
    Posts:
    50
    Hi all,
    Well I tested the way normalized works on a blank project and works perfect of course, even tried the Normalize method too, works fine. But for some reason in my current project both of these are always returning a zeroed vector, I have read in the docs that this can happen if vector is too small, but I tried same values on blank project and work correctly, in fact Im only getting input axis raw values so its easy to test and in "Survival shooter" project they used normalized the same way Im trying to use here, so is there any special case that could make the normalized vector 0 aside from it being too small? thanks in advance for any clue regarding this =).

    EDIT: Im sorry, I made a mistake, it was not normalized who was zeroing my vector, I cant believe i was fighting this for so long, as said Im very sorry, there is no issue with this, wish I could delete the thread
     
    Last edited: Jul 26, 2016