Hello fellow Robloxians. I am having some issues figuring out how to spawn a custom character based on what team you are on. In my game, I have a humans and a zombies team. I obviously want to spawn the players on the zombie team as one of my zombie models, but I can’t seem to get it working.
P.S. the “undead” variable is my ‘ReplicatedStorage.Zombies’ folder
During testing, the players character gets deleted and the zombie character appears. The only issue that happens is the zombie character doesn’t CFrame to the correct spot, the camera doesn’t move to the zombie, and the zombie character doesn’t move.
I have searched every where for answers and I can’t find anything that helps me. The only thing that I have found that is similar to this, is changing the starter character but that’s not what I want to do. I also have considered disabling character auto loading and creating my own spawning system, but I’m afraid this issue is going to persist. I’m unsure what to do from here so this is my last resort. Thank you for your time and help
Doing this from command line seemed to work just fine when I was trying to spawn a custom character; I didn’t need to edit any of the camera settings it just linked straight to the model and I could move fine. Just have to make sure you have the PrimaryPart set.
Hello! Good luck on your project.
I see you are changing PrimaryPart via code, but could you try setting it first, during the edit? Via using Explorer and Properties. Not sure if it would work but worth a try.
Second, can you check if it finds HumanoidRootPart after spawning? And right before getting PrimaryPart’s CFrame. Maybe it gets deleted somehow? Maybe you forgot to rig so it falls down? It’s better to check!
Hey! I actually did change the PrimaryPart via Explorer and Properties after I noticed it was possible yesterday haha. It ended up returning the same error, but I eventually figured it out! For some reason when I changed the PrimaryPart to the head and turned off Anchored on the HumanoidRootPart, it worked. When I went to apply these changed to my game, it still didn’t work. I then realized that the Player.Character:ClearAllChildren() was actually being run before the character had fully loaded. That means the character would finish loading with like 1 or two things left and that’s why it couldn’t find the characters PrimaryPart.