Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Model rotation is wrong

Discussion in 'Scripting' started by TRALLALAL, Jul 16, 2014.

  1. TRALLALAL

    TRALLALAL

    Joined:
    Sep 7, 2013
    Posts:
    132
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,500
    The image was downloading so slowly I couldn't see more than the top inch or so.

    Does the bad guy happen to be aiming at the player's feet?
     
  3. TRALLALAL

    TRALLALAL

    Joined:
    Sep 7, 2013
    Posts:
    132
    Nope, he aims at the head, here's an imgur link http://i.imgur.com/OqkrCuJ.png, i was wondering if I could just rotate the upper part of the body and not the legs via scripting but I don't think I can :|
     
  4. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,500
    His whole body is pointed upwards, though.

    Depending on how your skinned mesh is set up (I assume it's a skinned mesh, being a character model) then yes, you may be able to rotate just a part of it, though it might not be simple. The bones of a skinned mesh appear in the hierarchy as GameObjects, so have a play with them and see if any rotate the parts you need. If they do then you can mess with it just like any other GameObject - just remember to do it in LateUpdate so it gets applied *after* animation.
     
  5. TRALLALAL

    TRALLALAL

    Joined:
    Sep 7, 2013
    Posts:
    132
    His body is pointed upwards just when I'm close, everything works fine when I'm not :(