Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

IK Aiming help

Discussion in 'Animation' started by Laguna_Seca, Aug 7, 2018.

  1. Laguna_Seca

    Laguna_Seca

    Joined:
    Mar 13, 2014
    Posts:
    30
    [Sorry for my bad english.]
    I've already spent a lot of time trying to solve this problem. I need the skeleton of the character to rotate down / up following the crosshair.

    When I'm using SetLookAtPosition, my character puts his hands to the left and up.

    Code (CSharp):
    1.  
    2. animator.SetLookAtWeight(1, 1f, 1f, 1);
    3. animator.SetLookAtPosition(cameraLookPoint.position);
    4.  
    12.png 13.png


    I want to watch it should be at the point in the center of the camera.
    How is this problem solved? My animation without IK is direct and has no deviations. IK breaks animation.
     
  2. Mecanim-Dev

    Mecanim-Dev

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    1,574
    A LookAt is not an AimAt.

    a look at will align the forward vector(Z axis) of a transform toward a target.
    the animator built in look at does affect the chest, neck, head and eyes. So it really hard to align the gun on a target by changing the rotation of thoses 4 transforms, the only one really affecting the alignement on the gun is the chest.

    The basic idea is to align the forward vector of the gun toward the target and then apply IK on the hands to reach the gun. Some game adjust the position of the character first to avoid any weird pose too.