As of now, I'm making a game where NPC's will have to only take one path, and I need for them to be able to walk through each other. I have already solved the following issues --
CanCollide = false
.An issue came up to where whenever the NPC moved (for instance, with manually setting the MoveTo property of Humanoid), the Torso and Head would become CanCollide = true
. To solve this, I put the following script into the head (it's inefficient, but it was for the sake of testing) --
while true do script.Parent.CanCollide = false script.Parent.Parent.Torso.CanCollide = false wait() end
This did work, making the torso and head always stay CanCollide = false
. However, it still didn't work. Whenever I make an NPC MoveTo a position behind the other (which was a complete duplicate), it will still get caught on the other NPC about 95% of the time.
Whenever the NPC is moving, I can see the CanCollide property flash extremely quickly (as I would expect). Does this mean a shorter wait time would rectify the situation?
Or, is there another way to solve this issue (or another way to deal with NPC collision)?
Thanks for reading, and I hope to find out a bit more on this strange issue.
Use the Changed
event of the Head and torso and set the CanCollide to false in there. Voila.