how do you correct errors in a script?
I am using the latest version of unity and this script was taken out of a book to make the game character move. LEARNING 2D GAME DEVELOPMENT WITH UNITY BY MATTHEW JOHNSON the book is based on unity 2D version 4.5.1 and I used that at first and even that had problems.
I have created the first level and I'm stuck in chapter 5 because this script will not work and I don't know how to correct the errors that occur when I copy this script into visual studio and attach it to my game character. What is wrong with this script how should it be written to work properly.
public class PlayerController : MonoBehaviour
{
[HideInInspector]
public bool isFacingRight = true;
[HideInInspector]
public bool isJumping = false;
[HideInInspector]
public bool isGrounded = false;
public float jumpForce = 650.0f;
public float maxSpeed = 7.0f;
public Transform groundCheck;
public LayerMask groundLayers;
private float groundCheckRadius = 0,2f;
void Start()
{
}
void Update()
{
}
void FixedUpdate()
{
}
}
What errors are you getting? $$anonymous$$ake sure that the script name in the unity editor is the same as your class name (PlayerController).
I'm brand new to unity and trying to even make a game that's why I'm reading books and asking questions. I think you have forgotten what it was like to learn something because probably this is easy for you. so I'm no like the rest of you I guess.
Reopening this, since it's in the Help Room (was it always, not sure.) I don't know the history of this, but:
o I'm not sure if this Q was posted in the HelpRoom or moved later. But please, please, please the Help Room area is for Q's where you're wanting personal help learning Unity and game design.
o But a Question like this is fine for the HelpRoom. There are many, many things that it looks like someone could easily look up, but they don't know what to look up.
o But, but, this is still a professional site. "Snarky" is pretty much the limit, and we don't even like that.