Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

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

var simulationSpace: ParticleSystemSimulationSpace;

Description

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

var useLocal : boolean = true;

function Start () {
	useLocal = (particleSystem.simulationSpace == ParticleSystemSimulationSpace.Local);
}

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

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