- Home /
Roll a Ball Tutorial problem
I used the code given to me in the site, I'm using Unity 5.4.3 with this project and every time I check the code it says MonoBehaviour has unknown format!: Base Type: MonoBehaviour ByteSize:-1 MetaFlag;32768 (node index; o)
This is the code I;m using using UnityEngine; using System.Collections;
public class PlayerController : 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);
}
}
I use the error checker in Visual Studio but it says there are 0 errors, 0 warnings, 0 messages.
Answer by Petch12 · Jul 03, 2016 at 08:58 PM
Hmm Is the Script itself named "PlayerController"?
Does the object the script is attached to have a RigidBody?
The Script looks the same as the one Unity has supplied so it should work. Let me know if any of my suggestions work.
Your answer
![](https://koobas.hobune.stream/wayback/20220612083941im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Roll-a-ball tutorial does not work. 1 Answer
Can't get roll a ball to roll 1 Answer
Character triple+ Jumping: Please Help! 0 Answers
Roll a Ball tutorial error 4 Answers
Can't follow "roll a ball" tutorial. No cube rotate or GUI count. 2 Answers