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

How can I make NPCs "pass through" players?

I'm doing some work with AI and have been having quite a few problems. If I could get the result seen in the video linked below, however, it would solve a few of them. How can I make NPCs pass through players like shown here?

Video

Is the creator setting a CanCollide property to false for a second, forcing the player upward? I'm not really asking for code, just an explanation as to what properties they're changing so that I can attempt to replicate it. Thanks in advance.

1 comment

0

With filtering enabled they can set the NPC to cancollide false on the client, this would then mean the client would not collide with the NPCs if the NPCs Physics are handled on the server. Might not be what they've done, however it is a solution.

1 answer

for i,v in pairs(game.Workspace:GetChildren()) do
	if v.Name == "NPC" then
		for a,b in pairs(v:GetChildren()) do
			 b.Touched:connect(function(hit)
				if b.hit then
					b.CanCollide = false
				end
			end)
		end
	end
end

I dont know if this will work but I gave it my best shot.

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