Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 5 years ago

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.

0
what stops the collision groups from working? royaltoe 5144 — 5y
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 Ashenkorren 5 — 5y
0
Does it just work forward normally and then from nowhere turns around and walks into the other one? Worthfall 2 — 5y
0
I can take a look at it in studio if you have some sort of demo for me to test royaltoe 5144 — 5y
View all comments (6 more)
0
Also any tips on how to make it better would be appreciated Ashenkorren 5 — 5y
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. lmaoyboi 0 — 5y
0
turn off cancollide on the npcs lol Sk3pticalR0BL0X 33 — 5y
0
No ^. It's not that simple. DeceptiveCaster 3761 — 5y
0
Thanks guys but sadly this hasn't worked Ashenkorren 5 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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
Ad

Answer this question