Setting light intensity by getting closer to it

Was trying to set this up, so by getting closer to an object it’s light intensity goes from 0 to 100 depending on how close you are to it. Cant understand whats wrong

Hey @Sapper621! Welcome to the forums!

You don’t want to use “Get Actor Of Class” on tick, it’s really heavy and seems to pick an actor of the class at random. Also, it looks like you have “Cube” as an input, that is a mesh component, how are you acquiring that? Is it on the same actor as this code? Are you comparing the distance of two cubes?

If you could bring more information that would be great, but with what you have it’s impossible to know how to help. Get back with us soon! :slight_smile: