Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question FPS Animation based game with aim not working

Discussion in 'Animation' started by Kybo10, Jun 19, 2022.

  1. Kybo10


    May 25, 2015
    Hey guys, I am new to unity but I am a software developer by trade. I get the coding parts but I am confused when it comes to animation. I am currently making a FPS game that only plays when a button is held. This is because its for my mentally/physically disabled sister, so the regular FPS controllers didnt work for me.

    I currently downloaded the YBot character on mixamo, and the pistol idle animation. (,MotionPack)

    The way the scene currently plays out is I made an animation that moves the player position around a corner, then when its done it calls an event that lets the character know it can start aim/firing. I rigged up the player animation controller with a base layer that handles this movement of the player.

    The next move is given by a trigger in the script called "next", and the aim is a boolean.

    It should always do the base layer move, but only do the arms layer aim when the boolean is set.

    I got it to work with it only on the base layer, but I dont want to do a web of transitions between aim and each move animation.

    I thought about layer avatar masks, but since I am literally only animating the player transform position for the main game loop I didnt know if it would work. I also thought about just moving the gun and letting IK handle the rest of the work but whenever I move the gun even though its under the hand bone it doesnt move the hand.

    Does anyone know of a better way to have an animation moving the player transform AND an animation moving the gun from idle position to the aim position?


    - aimPlayer animation

    - player controller - arms layer

    - player controller - base layer controller.png

    - move animation - game loop move1.png