Differentiating NPC and Player
Hi all,
I having a little issue with differentiating player and NPC.
Side note: I have the NPC gizmo in the editor and enabled avatar ai_agent. I named my NPC "NameNPC"
I have this script that was referenced from "Intro to desktop Editor and Typescript". I added some logic to check if it's an NPC. If it is an NPC it will print "Should be NPC". If it is a player it will print "Should be Player"
Since I only have one NPC and myself. I was expecting to see "Should be Player" and "Should be NPC" printed once
However, not only was Should be Player printed three tiems, but it thought NPC was a player, than deleted the NPC and than said NPC is a player again. See attached below
This would be a problem because I have other logic where enemies will check when player entered world and follow that player, but it will start following the NPC instead because it thinks the NPC is a player
How come the NPC is treated as a player at the beginning? How can I make sure the NPC is never treated as a player - I don't want to have to check the NPC's name to see if it is an NPC
