Hi!
I’m new to Unity, and by now I watching several how-to videos. In one of them, that is published on officcila MS webiste is tought how to write scripts in Unity.
I’m using Unity 5, and come up with such issue. My object doesn’t respond to Move buttons. This method was taken from videoguide, I’m looking through.
using UnityEngine;
using System.Collections;
public class NewScriprt : MonoBehaviour {
public float move;
public float maxSpeed = 10f;
private Rigidbody2D rb;
// Use this for initialization
void Start () {
}
void FixedUpdate()
{
move = Input.GetAxis("Horizontal");
}
// Update is called once per frame
void Update () {
rb.velocity = new Vector2 (move * maxSpeed, rb.velocity.y);
}
}