- Home /
Why is Shurikan particle system variable textureSheetAnimation scripting not recognised?
I am trying to access the shurikan particle system's 'texture sheet animation' via script. From the Unity manual at http://docs.unity3d.com/ScriptReference/ParticleSystem-textureSheetAnimation.html , when I copy the code below:
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void Start() {
ParticleSystem ps = GetComponent<ParticleSystem>();
var ts = ps.textureSheetAnimation;
ts.enabled = true;
ts.numTilesX = 2;
ts.useRandomRow = true;
}
}
Unity produces an error:
Assets/SetParticleTexture.cs(51,29): error CS1061: Type UnityEngine.ParticleSystem' does not contain a definition for
textureSheetAnimation' and no extension method textureSheetAnimation' of type
UnityEngine.ParticleSystem' could be found (are you missing a using directive or an assembly reference?)
I am not sure why this is.. it doesn't produce a similar error if I, for example, address ParticleSystem.startRotation. Has anyone tried accessing textureSheetAnimation from script or know what I might be missing here?
Thanks for reading!
Answer by callen · Mar 09, 2016 at 06:12 PM
I see it just fine in my code. Are you using the latest Unity version? it may be a new property. I'm on 5.3.3