Since I’m going to build a game (I’m usually only creating high-quality modules) I’ve been using characters for my game. I want to have a detained/arrested character effect which is working for both the rig types R6/R15 and needs to be used on NPC’s and player characters.
R6 example rig. Left is the usual character. Right is the ‘arrested/detained’ rig.
I want to make those character change from the server to the character and the character cannot overrule it: other animations playing. I’ll make the character unmoveable (but that’s another topic).
I’ve tried to do it with animations (for the ease of character modifications) but it’s difficult for me to let them stay all the time for both NPC and PC (Player Character). Further, it’s probably not the most reliable method.
I’ve tried to modify the arms using CFrame but it looks like it’s changing the arm to my editing position.
X, Problem: You want to have player arms behind their back. You tried using animations but apparently didn’t get them to work out properly.
Y, Attempted Solution: Attempting to use CFrame to force player arms behind their back.
The Y, attempted solution, does not truly resolve your problem. Modifying the CFrame of the limbs still leaves them susceptible to being offset by animations and you aren’t setting them correctly either.
You should go back to using animations. As I mentioned above in the thread review, when working with limbs you are supposed to use the weld offsets (C0 and C1) with CFrames relative to the character’s torso as opposed to changing the limb’s CFrame altogether to a hardcoded world space.
It is possible to force arms to stay behind players’ backs without other animations playing over it. I’m not sure what your initial difficulty with them was though. Furthermore, animations are not unreliable, they are in fact very much reliable in terms of letting the engine handle offsets and movements.
Mind sharing the difficulties you encountered with animations? They are definitely what you’ll want in this scenario as opposed to hardcoded CFrames.
i agree with colbert, animations are the single most reliable and easiest solution right now
how i’d tackle this would be:
having an animation that only affects the limbs, has all other body parts locked (so other animations can correctly play on them, except the arms) and having the priority set to action (which makes it so that no animaton can override the handcuffed one).
you could easly position them behind the torso in exactly any pose you want, much easier, that offset will be kept no matter what because the arms are always animated relative to the upper torso!
plus you get to even animate the handcuffs with small motion like breathing or natural shaking
This is done by a RemoteEvent to an animation script in StarterCharacterScripts. It’s also having a detection between NPC’s and PC’s.
PC’s are working completely.
NPC’s aren’t animating, sadly. This is my code:
local arrestAnimation = Instance.new("Animation")
arrestAnimation.AnimationId = "rbxassetid://4178326828"
-- Arrestation script activator with some other code here. Not relevant to the topic.
arrestAnimationTrack = Humanoid:LoadAnimation(arrestAnimation)
It doesn’t run, not even on scriptless rigs. The animation is set on looping at the editor.