How do I make a Lego Party-like system?

What I mean with Lego Party-like system is how in Lego games, you have a party following you around and you can switch between characters.
The system I want would exist of several features:

  • The player controls 1 character, but pressing a button (for example q), would switch your control from one character to the other. It would also switch the camera to the new character.
  • It plays an effect going between the two characters.
  • The old character remains in the scene, and now acts like how the other npcs work.
  • The npc’s follow the player around, while still keeping a small distance.

How would I make a system like this? I’ve tried looking it up, but I can’t find anything.

1 Like

hi, please look at the format for scripting support, it says please don’t ask people to write whole systems for you.

I apologise, but I didn’t mean for it to sound like that. I don’t expect an entire system, I’m just asking for a way on how I should approach this and make this system myself.

1 Like

You can play with the Player.Character property to switch characters during gameplay. Or, if you want to have more camera control and predictable behavior, you can treat each character like a puppet that the player controls, something that just reacts to the players inputs. Whenever the player switches a character, the player just controls another puppet and the camera glides to it. You can then build from here to make any puppet that isn’t being manually controlled to follow the player like a pet, fighting enemies and whatnot.

You could possibly do something like the NPC’s following you around and then when you want to switch you can do

local charClone = character:Clone()
charClone.Name = plr.Name
plr.Character = charClone

local rootPart = charClone:FindFirstChild("HumanoidRootPart") or charClone:FindFirstChild("Torso")
local plrRoot = obj.Parent:FindFirstChild("HumanoidRootPart") or obj.Parent:FindFirstChild("Torso")

if rootPart and plrRoot then
	rootPart.CFrame = Desired_Position
end

charClone.Parent = workspace

for morphing (i sourced this from a shrek morph script so you should probably make this a function) and then keeping a list of all the characters and then recreating the old character and making them a NPC.

1 Like

As all good programs do. Shrek is love, shrek is life.

1 Like