Simulate particles relative to a custom transform component.
See Also: ParticleSystemSimulationSpace.Custom.
#pragma strict private var ps: ParticleSystem; public var relativeTo: Transform; function Start() { ps = GetComponent.<ParticleSystem>(); var main: var = ps.main; main.simulationSpace = ParticleSystemSimulationSpace.Custom; main.customSimulationSpace = relativeTo; }
using System.Collections; using UnityEngine;
public class ExampleClass : MonoBehaviour { private ParticleSystem ps; public Transform relativeTo;
void Start() { ps = GetComponent<ParticleSystem>();
var main = ps.main; main.simulationSpace = ParticleSystemSimulationSpace.Custom; main.customSimulationSpace = relativeTo; } }