Function OnUserInput not working

When using the function OnUserInput I am not receiving a message in the console. I have attached a screenshot for referenc

e.

Hi Drew,

Welcome to our community! :slight_smile:

That’s indeed strange. Why does 1 get displayed on the terminal screen? Please check your script. Maybe it was not saved properly.

Did you press enter/return? That ended up popping up in a previous thread.

Hi,

I’m not an expert but take notice that your ‘OnUserInput’ function is inside the main ‘Start’ function.
‘Start’ function is executed only once, at the beginning of the program.
‘OnUserInput’ must be related to the Unity ‘Update’ function that is executed in every frame and that leads to a conclusion it must be placed outside of the ‘Start’ function.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms