I’m basically making a test/joke game, so I don’t care about the details too much, just want to make something actually happen. This is my first time trying to use Unity.
The character is a rectangular prism with no animations. I have a rigidbody, a box collider, and the script “moving better hopefully”, which I found online (I named it though)
using UnityEngine;
using System.Collections;
public class movingBetterHopefully : MonoBehaviour {
public float speed;
private Rigidbody rb;
void Start ()
{
rb = GetComponent<Rigidbody> ();
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement * speed);
}
}
(Sorry for the formatting…)
I can set the inputs when I build the game, but the character can’t actually move. What do I need to do here? Thanks in advance, and sorry for being pretty ignorant about the whole process… I’ve been trying to get this working for probably a week now and getting pretty frustrated.