Aiming with Control Rig

Is it possible to use the Aim block (or something else) to aim a bone or a control using some arbitrary forward transform, not the bone/control’s forward vector?

[Image Removed]

Hey,

Yes, there is a node called Aim Math, where you have an input transform and then which axis you are using to do the aim. It will output a transform for the resulting aim input for any case you have.

Note that for your turret example here, there are probably multiple ways to solve it to your satisfaction, but as you add limits to things, the math can get much harder to maintain. I would suggest using a control that is positionally in the same area as the base of your gun to handle the offset. Then, take the resulting rotation of the aim of that control to the target and apply it to the base control.

[Image Removed]

Another way to handle the limits of your controls and simplify the underlying variables of the math would be to move the target’s aim position to be on the same plane that your turret rotates on (assuming it doesn’t tilt or pitch), making the aim calculation effectively 2D. This can also make the aim more reliable.

Hope this helps,

Dustin

That is dependent on the orientation of your controls. The primary aim direction would be the axis that you are using to aim, the secondary axis is often up (but doesn’t always have to be). So in my setup, the primary axis is X and the secondary is Z. There is no secondary target; we aren’t trying to aim that directionally as well.

Thank you! Could you please clarify the setup a bit since the screenshot is very low res and I can’t see the axes of the controls?

In this Aim Math block what should go to/the meaning of:

- Primary Axis

- Secondary Axis

- Secondary Target