I'm trying to make a gravity switch function but i keep getting this at line 14.
Unexpected symbol ` (expecting bla bla). Here is my code.
using UnityEngine;
using System.Collections;
public class GravitySwitch : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
function OnMouseDown () {
Physics.gravity = Vector3 (0, 1.0, 0);
}
function OnMouseUp () {
Physics.gravity = Vector3 (0, -1.0, 0);
}
}
↧