Legacy Documentation: Version 2017.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

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

Method group is Obsolete

ParticleSystem.simulationSpace

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
Obsolete public var simulationSpace: ParticleSystemSimulationSpace;
Obsolete public ParticleSystemSimulationSpace simulationSpace;

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"); }
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public ParticleSystem part; public bool useLocal = true; void Start() { part = GetComponent<ParticleSystem>(); useLocal = part.simulationSpace == ParticleSystemSimulationSpace.Local; } void Update() { part.simulationSpace = ((useLocal) ? ParticleSystemSimulationSpace.Local : ParticleSystemSimulationSpace.World); } void OnGUI() { useLocal = GUI.Toggle(new Rect(10, 60, 200, 30), useLocal, " Use Local Simulation Space"); } }

Did you find this page useful? Please give it a rating: