i have an object who swing from left to right or right-left between (-0,3 and 0.3), and what i want to do is when i press any key “space” the object fall to the ground.
using UnityEngine;
using System.Collections;
public class DropBox: MonoBehaviour {
void Update() {
if (Input.GetKeyUp(KeyCode.Space))
GetComponent<blocks>().enabled = true;
if (Input.GetKeyUp(KeyCode.Space))
GetComponent<blocks>().enabled = false;
}

