Hi,
I’m new to unity and coding in general, but have been working through some tutorials and guides on creating a top down 2D RPG style game. I’m hoping this will broaden my knowledge and give me some satisfaction when (and if) I complete it.
I feel like I’ve done well up till now, but seem to be getting a parser error flag up against some of the code I’ve recently added (to stop my player bouncing when walking against objects). Hopefully someone can help. Code below:
if (Input.GetAxisRaw (“Horizontal”) < 0.5f || Input.GetAxisRaw (“Horizontal”) > -0.5f)
{
myRigidbody.velocity = new Vector2 (0f, myRigidbody.velocity.y)
}
if (Input.GetAxisRaw(“Vertical”) < 0.5f || Input.GetAxisRaw(“Vertical”) > -0.5f )
{
myRigidbody.velocity = new Vector2 (myRigidbody.velocity.x, 0f)
}
Thanks,
Conor