Skip to content

StrangeAtmosphereSwitch

Fynn9563 edited this page Jan 28, 2026 · 2 revisions

StrangeAtmosphereSwitch

StrangeAtmosphereSwitch is a simple interactive component that cycles through atmosphere presets when players interact with it.

Video Tutorial

Coming soon - video tutorial placeholder

Overview

Use this component to give players control over the world's atmosphere. When interacted with, it tells the StrangeHub to switch to the next atmosphere preset.

Properties

Property Type Description
sceneHub StrangeHub Reference to the scene's StrangeHub
cycleOnInteract bool Whether to cycle atmospheres on player interaction

How It Works

  1. Player interacts with the switch object
  2. If cycleOnInteract is true, calls sceneHub.NextAtmosphere()
  3. Hub applies the next atmosphere (skybox, fog, linked objects)
  4. Wraps to first atmosphere after the last

Creating a Switch

Via the Dashboard

  1. Open the World Tab
  2. Set up your atmosphere presets
  3. Click Create Atmosphere Switch
  4. Position the created object in your scene

Manually

  1. Create a GameObject (often a sphere or button mesh)
  2. Add the StrangeAtmosphereSwitch component
  3. Assign the StrangeHub reference
  4. Enable cycleOnInteract
  5. Ensure the object has a collider for interaction

Setup Example

GameObject: "AtmosphereSwitchOrb"
├── MeshFilter: Sphere
├── MeshRenderer: Glowing material
├── SphereCollider: Radius 0.5
└── StrangeAtmosphereSwitch:
    ├── sceneHub: [StrangeHub reference]
    └── cycleOnInteract: true

Use Cases

Global Day/Night Cycle

Set up atmospheres:

  1. "Day" - Bright skybox, no fog, day lighting root
  2. "Sunset" - Orange skybox, light fog, sunset lighting root
  3. "Night" - Dark skybox, dense fog, night lighting root

Place switch in central location for players to cycle through.

Room-Specific Moods

Set up atmospheres:

  1. "Normal" - Standard lighting
  2. "Party" - Colorful skybox, disco lighting root
  3. "Chill" - Dim ambient, relaxed lighting root

Place switch near DJ booth or control panel.

Weather Simulation

Set up atmospheres:

  1. "Clear" - Blue skybox, no fog
  2. "Cloudy" - Gray skybox, light fog
  3. "Stormy" - Dark skybox, heavy fog, rain effects root

Place switch as a "weather control" prop.

Customization

Visual Feedback

The switch doesn't provide built-in visual feedback. Consider adding:

  • Particle effects on interaction
  • Material changes
  • Animation

Audio Feedback

Add an AudioSource and trigger sounds in a wrapper script:

public class AtmosphereSwitchWithSound : UdonSharpBehaviour
{
    public StrangeAtmosphereSwitch atmosphereSwitch;
    public AudioSource audioSource;
    public AudioClip switchSound;

    public override void Interact()
    {
        audioSource.PlayOneShot(switchSound);
        // The actual switch handles atmosphere change
    }
}

Custom Switch Logic

For more control, create your own script that calls hub methods directly:

public class CustomAtmosphereController : UdonSharpBehaviour
{
    public StrangeHub hub;

    public void SetDayMode()
    {
        hub.ApplyAtmosphere(0);
    }

    public void SetNightMode()
    {
        hub.ApplyAtmosphere(1);
    }
}

Best Practices

Placement

  • Put switches where players can easily find them
  • Consider multiple switches in large worlds
  • Make switches visually distinct from decoration

Visibility

  • Use glowing or animated materials
  • Add signs or labels indicating function
  • Consider hover tooltips (if using UI)

Number of Atmospheres

  • 2-4 atmospheres work well for player cycling
  • More than 5 can be confusing without UI
  • Consider dedicated buttons for specific atmospheres if many options

Troubleshooting

Switch not working

  • Verify cycleOnInteract is enabled
  • Check StrangeHub reference is assigned
  • Ensure object has a collider
  • Verify object is on an interactable layer

Nothing visible changes

  • Check atmosphere presets are configured in the hub
  • Verify skybox materials are assigned
  • Check linked root objects exist and have content

Only some things change

  • Ensure all atmosphere arrays are the same length
  • Check for null entries in arrays
  • Verify fog settings match expectations

Clone this wiki locally