Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Making a brick follow a player with no delay with FE?

I'm trying to make a NPC float behind a player with filtering enabled. With filtering disabled this runs smoothly, but with it enabled it has a pretty big delay.

I placed this script inside the HumanoidRootPart:

--Variables
local character = script.Parent.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local humanoidrootpart = character:FindFirstChild("HumanoidRootPart")
local followpart = script.Parent
local RunService = game:GetService('RunService')

--Teleport the NPC behind the player
followpart.CFrame = humanoidrootpart.CFrame * CFrame.new(2,4,3) 

--Move NPC
RunService.Stepped:connect(function(step)
	if followpart ~= nil and humanoid~= nil and humanoidrootpart ~= nil then
			local cf = humanoidrootpart.CFrame * CFrame.new(2,4,3) 
			followpart.BodyPosition.Position = Vector3.new(cf.x,cf.y,cf.z)
			followpart.BodyGyro.CFrame = humanoidrootpart.CFrame * CFrame.new(0,0,0)
	end
end)

All of the parts are set to Anchored = false and CanCollide = false

4 comments

0

You aren't crossing client and server? Filtering Enabled wouldn't have any affect on this.

0

This is probably inefficient but you can try making 2 of these bricks a local version of this so there isn't a delay, and a second one that's serverside, while making the serverside version of the brick transparent to the client itself.

0

This is in a normal script inside the birck,

0

@V_ChampionSSR You missed me

1 answer

I think you should Anchor the part that follows the HumanoidRoot because I had various problems like this if u were to move its position/CFrame it will just drop and glitch somewhere.

This discussion is preserved as it was. New answers, comments, and votes are closed.