Search Unity

Rotate script not working when I attach Animator object to it

Discussion in 'Editor & General Support' started by arvrappps, Mar 27, 2017.

  1. arvrappps

    arvrappps

    Joined:
    Feb 12, 2017
    Posts:
    24
    I have Rotation script attached to object and its working fine. But when I attach Animator ( I have state with animatio, which is called on touching the screen and otherwise always in Idle/empty state).to it rotation script not working..
    is there any workaround ?
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    If your animation in the animator sets the rotation of the root object, you cannot rotate that object any other way while the animator is active, even if the animation is stopped or paused.
     
  3. arvrappps

    arvrappps

    Joined:
    Feb 12, 2017
    Posts:
    24
    Hi Gambit-MSplitz
    What if I create a new empty gameobject and make that model child of it and attach that rotate script to empty gameobject ???
    I did it but and it works but not consistently ...sometimes it works sometimes not
    Is there any solution
     
  4. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    If you are trying to rotate the same object with an animation and a script, the script will not work. Even if the animation is on a parent object, as long as the child object rotates as part of that animation, the script will not work.
     
  5. arvrappps

    arvrappps

    Joined:
    Feb 12, 2017
    Posts:
    24
    Hi,
    Its Working... Animation on Child object i.e. my 3D model and rotate script on parent Empty Game Object.
    Its sucking due to Unity Remote4 for android.. Now I build the project and all is working fine.
    Thanks !