Search Unity

Find out when something is turning

Discussion in 'Scripting' started by nickavv, Aug 1, 2007.

  1. nickavv

    nickavv

    Joined:
    Aug 2, 2006
    Posts:
    1,801
    Is there any way to check when a GameObjects transform.rotation is going up or down? In the code for the player I can check this just by checking the keys that are held down, but in the automated AI version of the code I can't do that.
     
  2. seon

    seon

    Joined:
    Jan 10, 2007
    Posts:
    1,441
    If there is a rigid body on the GO, you can check its rotational magnitude.
     
  3. nickavv

    nickavv

    Joined:
    Aug 2, 2006
    Posts:
    1,801
    Yeah, there is. I'll look into that.