Hey there,
Not super sure what you're asking here, but I'll give it a crack. Do you just want to make it so you can open the gate with an arbitrary number of keys as opposed to just E?
if (Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.Space) || //Other keys you want to enable) {
if (!animation.isPlaying) {
//Gate open function here
}
}
This will allow you to have different keys in order to open the gate. Also, I would suggest using KeyCode to define keys as opposed to string lookups, as these can be slow. :)
Hope that helps,
Klep
↧