I need help with this C# script
using UnityEngine; using System.Collections;
public class Player : MonoBehaviour {
public float force;
private Rigidbody rb;
// Use this for initialization
void Start () {
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update () {
float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical");
Vector3 vector = new Vector3(h, 0.5f, v);
rb.AddForce(vector * force * Time.deltaTime);
}
} Estoy llevando cursos de Unity online y el instructor puso esas lineas de programacion, las copie igual y me salta el error de que no puede ser añadido, ¿alguien me puede ayudar? I'm taking online courses of Unity, and the instructor put those lines of programming, just copy them and I get an error that can not be added, can anyone help me?
In the future when posting questions on Unity Answers, please use a descriptive title, and include in your post any errors that you're seeing. http://answers.unity3d.com/page/faq.html
Your answer
Follow this Question
Related Questions
I can't test the game 0 Answers
Issue referencing a method that exists in a component that is only decided at runtime 1 Answer
How to make a script that could activate a aniamtion by activating a switch? 0 Answers
How do I change the coordinates of the GameObject to the first cube in the generated grid? 0 Answers