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
- how i move the npc with keycodes (should i spam if
input.KeyCode == Enum.KeyCode.W
,input.KeyCode == Enum.KeyCode.A
etc…) - 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…)
- 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