- Home /
Question by
aster2590 · Feb 23, 2015 at 01:02 PM ·
input.getkey
Input.KeyDown() after LoadLevel does not work
Hi guys !! I've a problem with Input.KeyDown() function. I call it in the Update(), but it does not detect any input after changing level. The script which i'm using has not been destroyed while changing scene.
Thanks in advance for any help!!
Comment
Which object in the new scene has the script assigned to it?
can you post your code? can't really find the problem with only this.
Douse the new level have the script with the [code] attached?
Update() {
Input.$$anonymous$$eyDown()
}
This is what your code says right?
Answer by Starwalker · Feb 24, 2015 at 02:25 AM
http://docs.unity3d.com/ScriptReference/Input.GetKeyDown.html
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void Update() {
if (Input.GetKeyDown("space"))
print("space key was pressed");
}
}
I think your trying to access wrong function. Check to make sure your Unity version is up-to-date with the reference.
Your answer
