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

I have a tower defense game and the NPC's walk into each other clogging up the path. Any help?

As I said, I have a tower defense game where the enemies walk down the path. The only problem is they walk into each other and I don't know what to do I have tried using collision groups,turning can collide off and various scripts. This is truly my last resort.

10 comments

0

what stops the collision groups from working?

0

To be honest...I don't know I am a new scripter and this is confusing but an error message doesn't show up

0

Does it just work forward normally and then from nowhere turns around and walks into the other one?

0

I can take a look at it in studio if you have some sort of demo for me to test

0

Also any tips on how to make it better would be appreciated

0

So, you're saying you've turned CanCollide off? If you are, then of course the NPCs would walk into each other. Collide means to crash into or to walk into something, so CanCollide means like 'can crash'. So turn on the CanCollide button.

0

turn off cancollide on the npcs lol

0

No ^. It's not that simple.

0

Thanks guys but sadly this hasn't worked

1 answer

The enemies are following eachother. You need to put a line in the code that makes them not chase eachother. Let's assume "target" is what the enemy is chasing, and the enemy's name is "Enemy"

if target.Name ~= "Enemy" then
	--script to follow the target
end

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