Key down, to edit property

Hello, I am trying to make a script that does the following:

When you press L it should change my (Spotlight)'s range to 20 and when you press L again, it should change it to 60, and then to 20 next time L is pressed :slight_smile:

Can you please help me with that? :slight_smile:

Thanks in advance, Andreas :slight_smile:

You can use Input.GetButtonDown for this. See Unity - Scripting API: Input.GetKeyDown and also: Check ifspecifickey ispressed - Questions & Answers - Unity Discussions