So basically what I’m trying to do is CFrame an R15’s arm to look towards a direction, I’m trying to get the arm to point forward to hand some one some cash. I really thought there was a way to easily do this using the motors and joints in the arm segments, but for some reason, though I try to adjust the DesiredAngle and all those properties on the motors, I don’t get any movement whatsoever. I’m almost positive you could do that before and it’d work wonders. I really don’t feel like making an animation to do this, so that’s out of the equation, atleast for now, if a simpler solution would be available.
Any help to this topic would be greatly appreciated, thanks for reading!
Get the pivot point for the joint either by using rig attachments or storing it from joint data. Then simply convert from world space to object space, making the cframe positioned at the pivots world cframe then setting the c0 and c1 by using local offsets from it. Rig attachments are set to be in the same position when rigged. You can use the attachment cframes as the offsets and change C0 or C1 accordingly. Example:
pivotWorld = body*bodyattachcf
towardLocal = CFrame.new(pivotWorld.p,targetPoint)
C0 = body:ToObjectSpace(towardLocal)
C1 = armattachcf --so it rotates along with
Thanks for the reply, Wunder! This is a bit hard for me to process/understand, but I’ll try to go about it by messing around. If it would be possible, any clarifications to make this easier for me to process would be highly appreciated. Thanks a bunch!
Update:
Ok! I figured it out. I was messing around with the Shoulder Motor, and that gave me some movement. I should be all good from here. Thanks guys!