Guide

Solar Tracker Script

Keep the starting solar generator aligned with the sun using the clock component and a forever loop.

Tutorial objective pattern · checked 2026-09-08

Guide artwork of a solar tracking array on a frozen alien planet
Guide artwork — not an in-game screenshot.

Quick answer

The starter solar tracker needs to keep the panel perpendicular to the sun. Read the sun elevation from the clock, subtract that number from 90, and feed the result into self.set_tilt_degrees(). Because the sun keeps moving, wrap the logic in a while True loop so the script never stops adjusting.

Working tracker pattern

clock = get_component("clock")

while True:
    sun = clock.get_elevation()
    self.set_tilt_degrees(90 - sun)

The rule to remember

The opening solar objective explains that the panel works best when sun elevation + panel tilt = 90. If the sun is at 60, the target panel tilt is 30.

Why the loop matters

A one-shot script can point the panel correctly once, but the sun keeps moving. The loop is what turns the calculation into automation rather than a one-time adjustment.

Checklist if it does nothing

  • Make sure you are editing the solar generator’s own script, because self needs to refer to that generator.
  • Get the clock component and read the current elevation every pass.
  • Use the tilt method from the generator docs; do not just print the calculated angle.
  • If a correct script appears to stop helping, check whether your growing base has simply outgrown its current generation/storage capacity.