Correct Aim IK

Acer

Member
Hi I have a character that is a litte bit to the left of the screen (I have moved the camera to the right) but now the aim is not corret.
So is there a way to make the character aim at the cursor? There is an Character IK script but I can't find like "Aim at target" or "Aim at cursor" or someting like that.
I have tried to setup an IKtarget with a Multi-AimConstraint script but that did not work so how do I fix this?



/Alex
 

Attachments

  • opsive_aim.jpg
    opsive_aim.jpg
    59.3 KB · Views: 3
The Third Person View Type will use the CrosshairsMonitor in order to determine if there should be any offset applied to the look direction. If this is still slightly off I recommend subclassing the ViewType and then adding an offset directly to the LookDirection method. I can also add this to my feature request list.
 
Is the CrosshairMonitor suppose to constantly update the look direction offset all the time(move the characters arms)? Because it does not do that for me.
It feels a little bit too complicated to do this? Because I have testet on another character models to use unitys IK aim and it works very easy. I just added IK to the hands and then setup a Multi-Aim Constraint and it works, the hands aim to the crosshair.
 
Maybe it's how you have your multi-aim constraint setup. In the demo scene if you move the CorsshairsMonitor Transform in the editor you can see the IK adjusting.
 
So I have setup an Multi-Aim Constraint and it works if I do not use the CharacterIK script but when I enable it the aim is a litte bit wrong. I think maybe my Multi-Aim Constraint for the arms first rotate but then after that the body is rotated with the CharacterIK and the aim is a litte bit offset.
I don't know if this is correct but how do I make my hand Multi-Aim Constraint execute after the body have rotated?
 
CharacterIK updates within the OnAnimatorIK callback. You'll need to do any of your adjustments after that. I recommend subclassing CharacterIK so you can be sure things are executed in the correct order.
 
Back
Top