Hi guys,
I doing a animated background.
Basically when the object reaches the position.x is desactived.
But this sprite that i’m working now, don’t move.
So i need that the animation occur one time, then the objective is desactived.
I’m using the code below for now…
Obs: Tamanho = SCALE
Thanks!
var speed : float;
var bloco : GameObject;
var maxposition : float;
var maxScale: int;
var minScale: int;
var tamanho: float;
function Start () {
}
function Update () {
tamanho = Random.Range(maxScale, minScale);
transform.localScale = new Vector3 (tamanho, tamanho,0);
transform.position += new Vector3(speed, 0, 0) * Time.deltaTime;
if (transform.position.x > maxposition)
{
bloco.SetActive(false);
}
}