Hey Guys
Im using this script but there is an error((76,9) Error CS8025 : parsing error) and i dont know how to fix it… Pls help me.
If i try to add it to my player it says it has not finished compilation…
Here is the script:
using UnityEngine;
using System.Collections;
public class PlayerMovement1 : MonoBehaviour {
private bool grounded;
private float speed;
private Vector2 startPos;
//
void Start () {
speed = 7;
grounded = true;
}
//
void FixedUpdate ()
{
transform.Translate(-Vector3.forward * -speed * Time.deltaTime);//
#if UNITY_EDITOR
transform.Translate (Vector2.right * Input.GetAxis (“Horizontal”) * 5 * Time.deltaTime);
if (Input.GetKey (KeyCode.Space) grounded == true)
{
rigidbody.AddForce (0,300,0,ForceMode.Force);
grounded = false;
}
#endif
#if UNITY_ANDROID
transform.Translate (Vector3.right * Input.acceleration.x * 7.5f * Time.deltaTime);
if (Input.touchCount > 0)
{
Touch touch = Input.touches [0];
switch (touch.phase)
{
case TouchPhase.Began:
startPos = touch.position;
break;
case TouchPhase.Moved:
if (Mathf.Abs (touch.position.y - startPos.y) > 100) //
{
float swipeValue = Mathf.Sign (touch.position.y - startPos.y);
if (swipeValue > 0 grounded == true) //
{
rigidbody.AddForce (0,300,0,ForceMode.Force);
grounded = false;
break;
}
else if (swipeValue < 0) //
{ //
break;
}
}
break;
}
}
#endif
}