unity3d - Horizontal axis not working after animation -


so, have built simple car game, , have attached script allows move on both axes. have created animation, if car turns upside down, there option press 'f' button , flip car normal. unfortunately, once animation plays , car flips onto it's wheels, car moves forwards , backwards, doesn't rotate.

what issue?

here script:

var speed : float = 10.0; var rotationspeed : float = 100.0; var carflip : animator;  function start () { carflip.enabled = false; }  function update () { var translation : float = input.getaxis ("vertical") * speed; var rotation : float = input.getaxis ("horizontal") * rotationspeed; translation *= time.deltatime; rotation *= time.deltatime; transform.translate (0, 0, translation); transform.rotate (0, rotation, 0); if(input.getkeyup(keycode.f)){     carflip.enabled = true; } if(input.getkeydown(keycode.b)){             speed = 30;         } if(input.getkeyup(keycode.b)){             speed = 15;         } } 

the animator updates transforms every frame change in update() being over-written.

if want override has done need apply changes during lateupdate().


Comments