I want to add aiming to my game. It is 2.5D and I only want it to aim up and down according to the crosshair position.
I already programmed the rotating crosshair and the player’s ability to aim directly at it. Now I just need animation to make it work. How can I do this kind of aiming (shown in the video)?
I only want to aim up and down. Also, I do not want to spend money on Final Ik just for one script. What can I do and how do I do it?
Use the “IKLimb.cs” script (last time I used this I needed to rename the class to match the filename)
Put the IKLimb component on an object that is NOT part of the arm hierarchy
Set up the various arm and target transforms on the controller
For weapon aiming, you may need to have the weapon itself rotating to “look at” the crosshair and put both arms as IKLimbs to hold the weapon.
–
Depending on your situation, you could also have an animation that lerps between looking straight up and looking as far down as allowed. Sample this animation with normalizedTime (0…1) based on the current aiming angle. If this can work for you and won’t require heaps of individual animations for different equipment or something, I would recommend it as it will be much more finely controllable.