Possible change rigs on pressing a key?

So, i wan’t to make an animation/emotes system. And the game is R6, and R6 Anim. Are not very good. So i thought about make something that changes the rigs to R15 and make animations of R15, but my question is how i do it? or even if it is possible, here is the script:

local player = game.Players.LocalPlayer
repeat wait() until player.Character.Humanoid
local humanoid = player.Character.Humanoid
local mouse = player:GetMouse()

local Animation = Instance.new("Animation")
Animation.AnimationId = ""

mouse.KeyDown:connect(function(key)
	if key == "e" then
		local playAnim = humanoid:LoadAnimation(Animation)
		playAnim:Play()
	end
end)

I hope you help me! Thanks :+1:

Question is your game R15 or R6 you arnt very clear?

My game is R6, And i want that when a player press a key, an animation of R15 is going to start, but first, the player in R6 will change to R15

Ok well in that case its impossible, you cant use R15 animations in a R6 game. (On players that is NPCs however you can.) *This is to the best of my knowledge.

Why do you want to switch the rig type just to play emotes? Sounds like a pointless workaround for not creating R6 and R15 versions of things. Your use case isn’t fully apparent or understandable and I’m heavily suspecting that this is representative of an XY problem.

If you are allowing both R6 and R15 animations, simply read off Humanoid.RigType and play off the appropriate animation. If the RigType is R6, play the R6 version. Ditto for R15. Don’t switch rig types just to play animations because that’ll just cause you unnecessary problems.

@PostApproval The game is already defined as a R6 game this would not work, as there would be no already R15 players what OP is asking is if there is a way to change a rig type from R6 to R15 to suit his needs, as a developer who takes part in developing in both worlds there are things that R15 cant do in certain games or doesnt look right, while R6 can do those things. This presents a problem for developers who need to use advanced animations that cant be done in R6 so OP is asking if there is a way to change the rig type of a player just to play an animation.

1 Like

See: first sentence.

It’s not that this code doesn’t work, that’s not true at all. It’s that for this situation it would supposedly be pointless because player choice is disabled. That isn’t exactly apparent and it took me some reads to figure this out, but I don’t want to make assumptions about the situation, hence why I danced my words around to be less assertive and more an “if” approach.

Switching rigs in a live game is not practical, especially not for single isolated cases like this (playing emotes). Simple answer, if it’s to switch rigs for a certain action, is not to do it.

Yes though, it is possible to switch rigs and that would be by assigning the current player’s character to an R15 construct and loading up everything it needs to function (scripts, HumanoidDescription, whatever).

1 Like

I don’t understand what you mean?

There’s nothing about this that doesn’t work in any respect of the word. It may specifically be not what OP is looking for, but there is nothing that won’t work here.

As for the follow up about practicality, don’t know what you mean there either or why that’s being brought up; that’s off-topic. Switching rigs in a live game can lead to potential issues and disruptions in game play if you’re doing it for small issues where you reasonably don’t require a rig change, hence impractical.

2 Likes

The only problem that i think is annoying are the possible lag spikes, without counting that, what could be a problem?