Skip to main content
Discovery icon for Official Unity Discord Discord server

Official Unity Discord

28,726 Online
140,080 Members
# 💻┃unity-talk4 people

How to toggle Unity lights

Toggle lights by enabling or disabling the Light component directly rather than trying to access a nonexistent Renderer component.

  • Attempting to access a Renderer component on a light object causes a console error because lights do not have renderers by default
  • To toggle illumination on button press, enable or disable the Light component instead of searching for a renderer
  • Using automated IDE features like auto-indentation prevents messy nesting and syntax scope confusion
Summarized from recent messages, might be inaccurate

More conversations

Talk, Play, &
Hang Out

Find your space to hang out, discuss the latest updates with the party chat, and see who's down to join your next match.
Get App