Simulate particles relative to a custom transform component.
See Also: ParticleSystemSimulationSpace.Custom.
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; } }
Did you find this page useful? Please give it a rating: