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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Enemy soldiers with animations. How to handle aiming at target(player). IK but...?

Discussion in 'Scripting' started by DoubleLee, Jan 19, 2016.

  1. DoubleLee

    DoubleLee

    Joined:
    Apr 11, 2014
    Posts:
    34
    I bought a package of low poly soldier with guns. The guns attach to the hand of the soldiers such as the M16 style rifle. The gun then moves along with the hand through animations. How should I handle getting the gun to point at the player given he will be somewhere in front of the soldier, but could be up down left or right a bit.

    I will probably need to use IK which I have a bit of experience with. The question is, should I disable the aim animation and just use ik? Should I use the aim animation + IK, or some how use just the aim animation?

    Take note the aim animation just points the gun forward which would work in a flat plane but my game has stairs and hills so the player could be up or down as well.

    Also with IK how does one go about making a gun that is typically held with two hands and then aimed? Would you set IK to the gun handle points and then figure out where to place the gun as aimed to the player? Or would you place the hands with IK in some recomputed points and then place the gun at those locations?

    Thank you and have a good one!
     
  2. DoubleLee

    DoubleLee

    Joined:
    Apr 11, 2014
    Posts:
    34
    There's gotta be a way to do this (the unity way). I ask again how is humaniod gun aiming done?