0
$\begingroup$

I am using some tracking constraints to get a gun to point to a hand. This is what I have so far:

enter image description here

It all works perfectly fine but as you can see, the left hand is not holding the gun meaning the gun rotation is off from when it started. My goal is to rotate the gun to make it be held in the empty hand.

i can't share my blend file so here is a diagram i made to show whats going on enter image description here

I could share the file later if needed but I don't have the time to prepare it right now (and my scene is an absolute mess).

The hand is a child of the gun handle and not the other way around so the hand will rotate with the handle when the gun is tilted.

Example:

enter image description here

enter image description here

To sum it up, the gun's rotation is incorrect and I don't know how to adjust it without removing the constraints.

EDIT : here is the blend file be sure to stay on the frame its on when it opens as i diddnt get to remove some keyframes

$\endgroup$
4
  • $\begingroup$ you could also give a Child Of constraint to the left hand, no? $\endgroup$
    – moonboots
    Commented Aug 31, 2022 at 16:09
  • $\begingroup$ i can but it already moves fine. its just the gun rotation thats off. also what would it be a child of? $\endgroup$
    – desperrrr
    Commented Aug 31, 2022 at 16:14
  • $\begingroup$ Think about your gun's roll. You need to specify two different markers to track. I'd rather do a damped track->locked track combo. Tracking -X is weird, because bones don't have any extent in that direction and you can't see that it is, indeed, tracking -X properly even if not with proper roll, except unless don't have the bone oriented perfectly in regards to the gun. Can't really answer without file though, so this is all I can offer. $\endgroup$
    – Nathan
    Commented Aug 31, 2022 at 16:29
  • $\begingroup$ @Nathan im not sure what "gun roll" means however i have edited the post to include the link to the rig. $\endgroup$
    – desperrrr
    Commented Aug 31, 2022 at 21:15

1 Answer 1

1
$\begingroup$

So let's look at the file, with the relevant bones highlighted, and your constraints. We'll do so with bone names and axes enabled, and with an octohedral display rather than sticks or shapes, because that will help us to be more aware of the axes of the bones.

enter image description here

So we can see that you're telling that bone to point its -X axis at the IK target, and indeed it's doing so.

Now, let's give that bone some rotation and see what happens:

enter image description here

Well, it's still constrained, so it's still pointing its -X axis at the IK target. But it's clear that those constraints aren't enough to determine the orientation of the gun: we're only controlling one axis with our constraints, which leaves us a whole range of inappropriate transforms.

That's what I meant in comments where I talked about gun roll. We know which direction one axis is pointing, the barrel axis, but we don't know which way any other axes are pointing, so the way that the gun rolls along its barrel is undefined.

To fix that, we need to fully determine at least two axes, which we can do with a damped track->locked track. First, we can damped track the hand IK target's head with our -X axis, just like we were doing before. Then, we'll need to point some other axis at some other marker, locking our X axis so it doesn't change. Because of how your bones are set up, we'll locked track our -Y axis at the tail of the IK target, because that makes things easy enough:

enter image description here

Now our rotation is fully defined, because we've set the direction that two axes are pointing. No matter how we rotate that gun, it won't matter. Its rotation is fully a function of its position and the orientation of the IK target (and the right hand's IK target will follow that rotation due to your existing child-of constraint.)

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .