Controllable NPC

so me and my friend are making a game and, one of the moves we want to have is the ability to pilot your NPC next to you (you have floating npc next to you). by pilot i means like when im press C it will make me have my camera on the npc and i can move around like its my character, and when im press C again he returned… and i can use my character normal. im not ask for script, just want to know what ways to do this because it seems like very hard task, and i not know what things i could do to get a result like this

  1. how i move the npc with keycodes (should i spam if input.KeyCode == Enum.KeyCode.W , input.KeyCode == Enum.KeyCode.A etc…)
  2. how i keep character in place while still moving npc (thought of using isrunning and then setting walkspeed to 0 but then isrunning wont be activate…)
  3. how to put camera on npc, will i be able to make it moveable like a normal player character? (like rotate around you)

my codes:

RunService = game:FindFirstChild("Run Service")
CameraPart = workspace.Stand.CamPart
local uis = game:GetService("UserInputService")
local plr = game:GetService("Players")
local Stand = workspace.Stand


RunService.RenderStepped:Connect(function()
	workspace.CurrentCamera.CFrame = workspace.Stand.CamPart.CFrame
end)



uis.InputBegan:Connect(function(InputKey, GPE)
	if InputKey.UserInputType == Enum.KeyCode.W then
		Stand.Humanoid:MoveTo(Stand.HumanoidRootPart.Forwards.Position)
	end
end)

it do sometime work but it takes time to work and it probably not efficient

you guys have idea? let me know, if you do well be safe wash you hands. i hope to see you in next reply

Is there currently a game we can join so we can see?

1 Like

here:

give it a minute or so and then u will be able to control

1 Like

From what I know I think you just gotta set the Camera Subject to the Humanoid of whatever character you wanna control so to do this type of system you`ll just need to set the Camera Subject to the Npc Humanoid and then press it again and it sets it back to Your Characters Humanoid