Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

ParticleSystem.simulationSpace

Switch to Manual
public var simulationSpace: ParticleSystemSimulationSpace;

Description

This selects the space in which to simulate particles. It can be either world or local space.

var part: ParticleSystem;
var useLocal : boolean = true;

function Start () { part = GetComponent.<ParticleSystem>(); useLocal = (part.simulationSpace == ParticleSystemSimulationSpace.Local);

}

function Update () { part.simulationSpace = (useLocal ? ParticleSystemSimulationSpace.Local : ParticleSystemSimulationSpace.World); }

function OnGUI() { useLocal = GUI.Toggle(new Rect(10, 60, 200, 30), useLocal, " Use Local Simulation Space"); }