I tried to make it where the green square in that blue rectangle would get a red outline when the player presses 1. But its not working.
Here’s the code. And what the screen is supposed to look like when the player presses 1. I disabled the outline but it didn’t work. I think I’m on a new unity version
What script gets when the player presses 1?
In order for code to run, it has to be called by something. For code to exist in the game world, it needs to be attached to a script that is attached to a game object as a component. Where is NewBehaviourScript1 attached? If it isn’t attached to the object, you’ll need to fix that.
After it’s attached, you’ll need to actually call the function you’ve written. “void UpdateScreen()” and everything inside the { — } is a function, and will run every time it’s called. Unity gives you two functions on most objects by default - Update() (which happens many times a second while the game is running) and Start() (which runs just once when the object is created while the game is running).
You could try writing
void Start() { UpdateScreen(); }