Search Unity

animation nonplayer character

Discussion in 'Animation' started by veradesrt, Oct 14, 2018.

  1. veradesrt

    veradesrt

    Joined:
    Oct 14, 2018
    Posts:
    2
    how to indetify if an item is moving and then set bool to true?

    i need it to move animals from idle to walking and back. forum.PNG
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    Well, seems like you need to detect if it's sitting still or not, and that depends on how you move them around. If the animals use physics, then rigidbody velocity being nearly zero could mean they are stopped. If no physics, maybe keep a variable showing if they moved last frame or not (set to true if they move, but also set false if no movement is applied), and if that shows movement, then set the trigger/bool on the animator.
     
    veradesrt likes this.
  3. veradesrt

    veradesrt

    Joined:
    Oct 14, 2018
    Posts:
    2
    it does have a rigedbody... but how to do it?