Version: 2022.2
LanguageEnglish
  • C#

ParticleSystem.textureSheetAnimation

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
public ParticleSystem.TextureSheetAnimationModule textureSheetAnimation;

Description

Script interface for the TextureSheetAnimationModule of a Particle System.

This module allows you to add animations to your particle textures. This is achieved by authoring flipbook textures, which look like this:



Each numbered region represents a frame of the animation, and must be distributed evenly across the texture. Select a variable below to see script examples. You may want to use this texture on your Particle System with each example, to see how the module works.

Particle System modules do not need to be reassigned back to the system; they are interfaces and not independent objects.

using UnityEngine;
using System.Collections;

[RequireComponent(typeof(ParticleSystem))] public class ExampleClass : MonoBehaviour { void Start() { ParticleSystem ps = GetComponent<ParticleSystem>(); var ts = ps.textureSheetAnimation; ts.enabled = true; ts.numTilesX = 2; ts.rowMode = ParticleSystemAnimationRowMode.Random; } }