-
-
Notifications
You must be signed in to change notification settings - Fork 0
StrangeAtmosphereSwitch
StrangeAtmosphereSwitch is a simple interactive component that cycles through your atmosphere presets when players interact with it.
Video Tutorial
Coming soon - video tutorial placeholder
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 you've configured.
| Property | Type | Description |
|---|---|---|
| sceneHub | StrangeHub | Reference to the scene's StrangeHub |
| cycleOnInteract | bool | Whether to cycle atmospheres on player interaction |
- Player interacts with the switch object
- If
cycleOnInteractis true, callssceneHub.NextAtmosphere() - Hub applies the next atmosphere (skybox, fog, linked objects)
- Wraps to first atmosphere after the last
- Open the World Tab
- Set up your atmosphere presets
- Click Create Atmosphere Switch
- Position the created object in your scene
- Create a GameObject (often a sphere or button mesh)
- Add the StrangeAtmosphereSwitch component
- Assign the StrangeHub reference
- Enable
cycleOnInteract - Ensure the object has a collider for interaction
GameObject: "AtmosphereSwitchOrb"
├── MeshFilter: Sphere
├── MeshRenderer: Glowing material
├── SphereCollider: Radius 0.5
└── StrangeAtmosphereSwitch:
├── sceneHub: [StrangeHub reference]
└── cycleOnInteract: true
Set up atmospheres:
- "Day" - Bright skybox, no fog, day lighting root
- "Sunset" - Orange skybox, light fog, sunset lighting root
- "Night" - Dark skybox, dense fog, night lighting root
Place switch in central location for players to cycle through.
Set up atmospheres:
- "Normal" - Standard lighting
- "Party" - Colorful skybox, disco lighting root
- "Chill" - Dim ambient, relaxed lighting root
Place switch near DJ booth or control panel.
Set up atmospheres:
- "Clear" - Blue skybox, no fog
- "Cloudy" - Gray skybox, light fog
- "Stormy" - Dark skybox, heavy fog, rain effects root
Place switch as a "weather control" prop.
The switch doesn't provide built-in visual feedback. Consider adding:
- Particle effects on interaction
- Material changes
- Animation
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
}
}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);
}
}- Put switches where players can easily find them
- Consider multiple switches in large worlds
- Make switches visually distinct from decoration
- Use glowing or animated materials
- Add signs or labels indicating function
- Consider hover tooltips (if using UI)
- 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
- Verify
cycleOnInteractis enabled - Check StrangeHub reference is assigned
- Ensure object has a collider
- Verify object is on an interactable layer
- Check atmosphere presets are configured in the hub
- Verify skybox materials are assigned
- Check linked root objects exist and have content
- Ensure all atmosphere arrays are the same length
- Check for null entries in arrays
- Verify fog settings match expectations