- Home /
How make script many people
I have 3 people and all use same script "HumanAI.css"
There's code "trigger enter" and many other things. My problem is my speak menu script go like this:
HumanAI e = gameObject.GetComponent<HumanAI>();
if(e.enter) {
Debug.Log("Triggeri oli päällä. Boss = " +e.boss);
if(Input.GetKeyDown("f")){
Debug.Log("Painoit F kirjainta" +TalkingMenu);
if (e.boss) {
TalkingMenuBoss = true;
} else {
TalkingMenu = true;
}
SomeMenu=true;
Screen.lockCursor = false;
mainCamera.enabled = false;
firstPersonControllerCamera.enabled = false;
InfoMenu=false;
}
}
That "f" button works only if i stand all 3 people trigger same time. How i can make like that i stand one and system watch who's trigger i stand? Sorry my bad english. :)
I had this same problem with my Tree Chopping script. The only way I fixed that was attaching it to my character and re-coding it to say; if the character is in range of the tree then chop, and not if the tree is in range of the character. Try to adapt it to your character maybe?
If you're using triggers, you should use the OnTriggerEnter function.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Controlling AI Movement 0 Answers
Selecting and deselecting not working 0 Answers
Edit this code? 0 Answers
Killable NPC who can kill player 1 Answer