Difficulties with player movement after changing character

As of around roughly 4 weeks ago (I wasn’t online at the time so I’m not sure specifically when) Player movement stopped functioning after a character change was called. This happens with any method of character change, such as directly setting the players character to a different rig or putting the rig in StarterPlayer. Shift lock and animations works correctly as does calling MoveTo() on the players humanoid which rules out any mistakes with the rig, lack of speed or anchored parts. I have also made sure that :Disable() was not being called on the players controls (I even tried having it automatically call :Enable() on them). The problem also is likely not the PlayerModule or any of the children modules of that as I managed to find an older version (I believe from around a month ago) and replacing the current PlayerModule with that did not solve the problem. As far as I’m aware, no changes were made to the scripts/rigs at the time of the problem starting which leads me to believe that this is either a problem with studio/Roblox itself, or that a change was made to how the players controls are transferred that I am not aware of. Additionally setting up a Character Controller instance did not solve the issue either.

Edit: For those who dont want to read to the bottom, I currently beleive it is an issue with Roblox. Specifically after character change the movement actions remain however the functions they are tied too stop being fired (there is also no actions that would overwrite them). If anyone knows what could be causing this your help would be greatly appreciated.

2 Likes

Do you reset the player everytime they change rigs? Are the new rigs massless? Are they unanchored?

The players character is changed to the new rig and the CameraSubject is set to the rigs root part. The rigs are not massless and as stated previously they are unanchored.

So I had the idea that if it was specifically the character change that was causing the problem, then I could write my own function to change the character manually by deleting everything in the current character exept for the root part and the humanoid, moving everything from the new character into it, and then re welding the root part. Unfortunately this also has the same problem as just changing the character directly.

The main thing thats throwing me off currently is just the fact that the rig IS capable of movement, its just that the players controlls are seemingly being ignored. But I did some tests with the PlayerModule and calling :Enable() on the controls returns true which iirc means that it thinks the controls are currently enabled.

I put print statements in various parts of the Keyboard module since as far as I can tell that handles all of the movement inputs. UnbindContextActions() is not called at any point during the character change, however the print statement I put in handleMoveForward stops outputting anything afterwards.

Are you trying to clone the rig into the player’s character and then destroy the player’s original rig afterwards? If so then that might be the reason why the player won’t move, is because the humanoid or the game probably doesn’t realize that there’s a new rig in the character.

The workaround for not doing LocalPlayer.Character = NewRig (Not the actuall code just a barebones example), was to delete everything unnesisary from the current character, create a clone of the new rig, and move everything from that rig into the current character, however since that came up with the same problem I just got rid of that function in favor of setting the character directly.

This is probably the case, my idea is that the game probably doesn’t know there’s a new rig inside of the player’s character, therefore making you unable to move manually

That link is not anywhere close to what im trying to acheive. Its a fully custom rig, not just a different HumanoidDescription and accesories.

I dont feel like that would be the case, as more things would cease to function if it didnt register the character correctly. However if you know how to fix it if that is indeed the problem then ill try it.

I found another link which is outdated sadly, but it will probably give you some ideas though [outdated] Changing Character while ingame with Custom Rigs:

1 Like

Thats effectively the same as what im doing so unfortunately no luck there.

I’ve gone through a lot of the forums on character changing/issues people had with it and unfortunately the problem im having was not covered in any of them, most of the problems were simple rig mistakes or other things along those lines. I beleive iv narrowed the problem down to the PlayerModule’s Keyboard module, however im not sure exactly how it functions or what other modules require it so currently im a bit stuck. It seems like the ContextActions are being unbound when the character changes, although the function that would do that isnt being called.

So your problem here is the rig doesn’t work on the player when you change them WHILE they are in the game, but if you put the rig in StarterPlayer it works?

No it doesnt work in either case, specifically movement keys have no effect on the character after the change is made while other things like shift lock still work.

This article might work for you Why won't this rig work? - #8 by Confederation_Major They are also having a problem with their rig

No luck there either unfortunately, the rigs have humanoids and play animations correctly. (At least when the animator script doesnt decide to mix them all lol)

What about the humanoid RigType? did you change it in your character?