Motor6D creation ( with proper offset ) through scripts in the middle of gameplay

This is a particularly difficult thing to achieve to my knowledge, and I can’t think of how it might be accomplished.

In the middle of gameplay I want to have the player basically aim in a direction using their arm, y’know, simple stuff, I also don’t want it to be impacted by the player’s animations so it remains separate. I already have the code to achieve this mostly. However there is an issue, in order to make it work the player’s Right Arm must be fixed to the body using a Weld of some variety since, y’know, otherwise it’d just drop off due to rigs having to be unanchored to move properly.

At times in gameplay where the Right Arm needs to be usable in animation again I want to have a trigger of sorts create a Motor6D, a new shoulder joint temporarily, so the arm actually fits properly in the animations, which, y’know, not too hard to do, right?

Not quite, and I’ll explain why.
Observe this image of a rig which has this done to it. ( RigEdit Lite view shown of the effect )
image
As you can see on the left of the image, the Right Arm has a different rig to the Left Arm, with the usual Shoulder joint. The problem here is that, to my knowledge, you cannot replicate the offset of the Motor6D instances through scripts in the middle of gameplay.

It might be possible but I am not sure how, any ideas on how to achieve this?

I ideally don’t want to have a model arm be layered over the regular arm since although that could technically work, it would be constantly moved about by the player’s animations unless I specifically dug into them and made each arm animation offset so it’d never do that and that would be pain and torture and please no

1 Like