How can I make NPCs not ignore non collideable parts?

Are the grey parts inside the NPC models? Pathfinding ignores humanoids, so you could try attaching it as a separate part outside the NPC models. I suppose using a normal weld to keep them attached to the NPCs would work…

1 Like

uh no, they’re parts inside the character model

image

don’t mind the naming i know what is what :grin:

1 Like

Sweet, so basically, all you have to do is use PathFindingModifiers to fix it.
in pathParameters add cost of GreyPart to make sure npcs ignore it.

local modifier = Instance.new("PathfindingModifier")
modifier.ModifierId = "GreyPart"
modifier.Parent = greyPartInstance

local pathParameters = {
		AgentRadius = 2,
		AgentHeight = 2,
		AgentCanJump = true,
		AgentCanClimb = false,
       Costs = {
        GreyPart= 10
         }
	}

by manually making the cost of going through GreyPart, you can force the npcs to ignore it in the path

3 Likes

Name or Path?

Name doesn’t seem to make them go around it.

1 Like

Oh yeah you would have to do something like this:

local modifier = Instance.new("PathfindingModifier")
modifier.ModifierId = "GreyPart"
modifier.Parent = greyPartInstance

and then do
GreyPart = 10

its supposed look for “ModifierId” lemme edit and fix the error above rq

1 Like

shouldn’t it be .PassThrough = bool instead of ModifierId?

ModifierId doesn’t seem to be a thing

1 Like

Its been quite long since I’ve used pathfinding, they must’ve made changes to it? Yeah sure try .PassThrough = false , weird, I used ModifierId like a month ago or something

1 Like

yeah that seems to semi-do-the-trick

you can still stack them in one place by running in circles while they chase you

NPCs are one of most difficult things to make. Why u don’t make any simple game before?

1 Like

If you’d want it to be more precise, you’d have to think out of the way and go for something like RayCasting and then moving them out of the way if ray hits greyPart, this is a bit complicated to think about and implement though.

2 Likes

what is this even supposed to mean

they work like they should, i just want to make them avoid one part

1 Like

sounds like a hassle to do, no thanks

when i doubt, find a simpler way out :sunglasses:
(i will probably tamper with melee combat a bit)

2 Likes

So they work, but u don’t know how to set collision group?

1 Like

yes i’ve never worked with collision groups before??

Really? Collisions group is so visible thing on the parts. Even name of it clearly tells some parts can collide some not.

visible thing on the parts…

it’s inside properties

1 Like

And properties are visible window on the screen.

1 Like

if you’re really that curious as to why i “didn’t make a simpler game”:

footage is nearly 2 weeks old, a lot has changed since

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.