How do I make a client-sided npc?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I want to achieve a client-sided npc that only shows up on a players screen. On my screen, there’s only 1 NPC in the game and it is following me. On your screen, there would be 1 NPc in the game and its following you.

  2. What is the issue?
    I just cannot figure out how to make it work.

  3. What solutions have you tried so far?
    I have checked the DevForum, Education and Developer hubs. I have tried making a StarterPlayerScript that inserts the NPC into the players camera and makes it follow the local players character. It just didn’t work.

StarterPlayerScript:

local plr = game.Workspace:WaitForChild("Camera")
local npc = script.VirtuaIPixI:Clone()

npc.Parent = plr
2 Likes

It’s likely because the scripts moving the NPC are server sided, try to make them local scripts instead.

Also it’s “CurrentCamera” unless you’re specifying a specific Camera. Likely making an infinite wait for child loop.

CurrentCamera is a property of workspace, the name of the camera object is “Camera”. Their code would still work.