Increase Light size

Hi there. I’m fairly new to scripting, but I have a good handle on the basics of coding.

Here’s what I’m trying to do:

2D sidescroller.

My player controller has a point light on each side of it. These two lights are childs to the player controller object so that they are always following the player controller. The game is pitch black aside from these two lights.

When my player controller runs into a certain block, I want each light to increase by x amount.

I’m not looking for a word-for-word answer, I want to figure this out on my own, but I would like some help to point me in the right direction because I’m stuck =/

I know I’ll need to use OnTriggerEnter(); , but after that I haven’t been able to find a way to access the lights that are child’d to my player controller object.

The above page should help you figure out how to acces components in child objects.

And if needed, you can check out how you can use the Light component here: Unity - Scripting API: Light

1 Like

Thanks a lot Timelog, I figured it out :slight_smile: