using UnityEngine;
using System.Collections;
public class LadderControl : MonoBehaviour {
public bool LadderCont;
public Collider LadderMesh;
public MeshRenderer LAC;
private bool Anim;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(LadderCont == false){
LAC.animation["LadderUp"].wrapMode = WrapMode.Once;
LAC.animation.Play("LadderUp");
LadderMesh.enabled = false;
}else{
LAC.animation.Play("LadderDown");
LadderMesh.enabled = true;
}
}
}
Basically, I have a button activated using a Raycast. I have an animation for a ladder coming up and a ladder sliding back down. However, the animation loops for some reason. Can anyone help me with this small problem?