I was watching and doing the project from this video, but I encountered three CS 1061 errors on 33:04.
The following is my code
using UnityEngine;
using System.Collections;
public class respawn : MonoBehaviour {
private Vector3 startPos;
private Quaternion starRot;
// Use this for initialization
void Start (){
startPos = transform.position;
starRot = transform.rotation;
}
void OnTriggerEnter(Collider col)
{
if (col.tag == "death") {
transform.position = startPos;
transform.rotation = starRot;
GetComponents<Animator>().Play("LOSE00",-1, 0f);
GetComponents<Rigidbody>().velocity = new Vector3(0f, 0f, 0f);
GetComponents<Rigidbody>().angularVelocity = new Vector3(0f, 0f, 0f);
}
}
}
And those are the error I got
error CS1061: Type `UnityEngine.Animator[]' does not contain a definition for `Play' and no extension method `Play' of type `UnityEngine.Animator[]' could be found (are you missing a using directive or an assembly reference?)
error CS1061: Type `UnityEngine.Rigidbody[]' does not contain a definition for `velocity' and no extension method `velocity' of type `UnityEngine.Rigidbody[]' could be found (are you missing a using directive or an assembly reference?)
error CS1061: Type `UnityEngine.Rigidbody[]' does not contain a definition for `angularVelocity' and no extension method `angularVelocity' of type `UnityEngine.Rigidbody[]' could be found (are you missing a using directive or an assembly reference?)
Basiclly what those three line do is to play an animation on a character called unitychan after you died like the one after 33:04 in the video.
I am so new to unity, and I really need a help here.