Is there a way to enable the Npc script only when the player enter in a trigger? And disable when he exit?
I know how to set up a trigger but I don't know what action can do this... like an Object, Npc, Send message, Turn off and Turn on...
I have 5 npc and when they are all activated, in the profiler the voice "NPC.FixedUpdate" is at 86% and all slow down... when I uncheck the Npc script, all is working clear and smooth and become 0,1%!
I also tryied to remove the capsule collider but become 75%...
Tx
Comments
Either way, you're nearly there!
GameObject.Find ("NPCMacho").GetComponent ().enabled = false;
I am trying to enable/disable a frame-flipping script attached to my Player prefab game object. I am doing exactly the same as @2finger here, but I am getting error 'SUC_FrameFlip' is a type, which is not valid in the given context.
I am really a coding noob - I thought this was pretty straightforward, but I have no idea what I am doing wrong here. Please help.
The correct syntax would be:
It works, thank you!