AlignPosition and AlignOrientation don't work, am I doing something wrong?

Hello. I’m attempting to make VR hands with collision and I’m using AlignPosition and AlignOrientation as many others have suggested. However, they just don’t seem to do anything. The Active Property is disabled on the Instances, and they don’t actually change anything. I’ve looked at tutorials, and I’ve tried inserting it via the studio tool to see how the hierarchy works. I’ve copied the pattern, but it doesn’t seem to work for me. Here’s my code:

local a0 = Instance.new("Attachment")
a0.Parent = collision

local a1 = Instance.new("Attachment")
a1.Parent = hand

local alignPos = Instance.new("AlignPosition")
alignPos.Parent = collision

local alignRot = Instance.new("AlignOrientation")
alignRot.Parent = collision
	
alignPos.Attachment0 = a0
alignPos.Attachment1 = a1

alignRot.Attachment0 = a0
alignRot.Attachment1 = a1

Both hand and collision are regular parts. The hand part constantly follows the player’s controller UserCFrames.

You forgot to change the mode to one attachment.

But in this case I’m using two attachments… Was I supposed to only use one? From the docs I assumed that how I programmed it was the intended behavior, and it’s default Two Attachment when you insert the constraint via the model tab

Oh, my mistake. You could use either one or two attachment modes.

You could have it at one attachment and set the position and CFrame of the position and orientation. Try that first.

I tried this already with AlignPosition, that didn’t seem to work unfortunately

Interesting. The active property is an indicator for whether it’s active or not. If it’s disabled, it does not work.

I usually play around with the constraints while I’m in game just to see if there’s a specific property I must use.

1 Like

Yeah, I figured

I tried this for a bit and it didn’t seem to help either