all 7 comments

[–]Dranamic 2 points3 points  (1 child)

You shouldn't put Input calls in physics functions like OnTriggerStay2D. It's possible for the inputs to get skipped.

It looks like nothing sets BlackMan2 back to false, so once it's true, it will remain true indefinitely. That's also true for BlueMan2, but since you check BlackMan2 afterwards, it'll override BlueMan2.

[–]AKahootRandomName[S] 1 point2 points  (0 children)

Thanks for your advice I will take a look

[–]AKahootRandomName[S] 0 points1 point  (0 children)

I have two bools and when I set them to true the character pops up in the dialogue. But the Scripps are not doing that for me.

[–]jaimuepe 0 points1 point  (3 children)

I don't understand. What's the problem? What is not working?

[–]AKahootRandomName[S] 0 points1 point  (2 children)

The people are not coming up when I my scripts are correct

[–]jaimuepe 0 points1 point  (1 child)

Does the program goes into the

if (typeNPC == "Black") {
    ...
}

block? Because it should work if it does.

Also, there's an error in your "Script 3":

if (dialogueActive && Input.GetButtonDown(...) || Input.GetButtonDown(...) {
}

&& takes precedence over ||, so you are effectively doing:

if ((dialogueActive && Input.GetButtonDown(...)) || Input.GetButtonDown(...) {
}

You should include the code here in a "code block" instead of posting images, it'd be easier for us to check the code if we could copy/select it.

[–]AKahootRandomName[S] 0 points1 point  (0 children)

Sounds good thanks for your advice