I’m using this script:
using UnityEngine;
using System.Collections;
public class PlayerControl : MonoBehaviour {
public float maxSpeed = 10f;
bool facingLeft = true;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void FixedUpdate ()
{
float move = Input.GetAxis("Horizontal");
rigidbody2d.velocity = new Vector2 (move * maxSpeed, rigidbody2d.veocity.y
if(move > 0 && !facingLeft)
Flip ();
else if(move < 0 && facingLeft)
Flip ();
}
void Flip()
{
facingLeft = !facingLeft;
Vector3 = transform.localScale;
theScale.x * = -1;
transform.localScale = theScale
}
}
And I get CS1526 at 21, 26: needs () or or something like that. Help!
Line 19 you don’t closed Vector2 constructor. Just put a ); on the end of the line.