I want my player to destroy a cube when the down arrow key is pressed on a keyboard. I know I need to use the Destroy (Object); command but what would be the entire script?
class destroyObjectScript {
void Update() {
if(Input.GetKeyDown(valueForArrowDownKey) {
Destroy(gameObject);
}
}
}
I would tell you to look up what the value for the Arrow down key is, but since it appears to be down, the IDE will probably help you auto-complete it.
thats what i get for copying the above text
class destroyObjectScript {
void Update() {
if(Input.GetKeyDown(KeyCode.DownArrow)) {
Destroy(gameObject);
}
}
}