Hi All!
I am trying to create a game that is using just the keyboard, no mouse. I would like to make it so when you open up the inventory the 'examine' action runs as you scroll over each item.
Right now I have it so you can examine the items by pressing the 'examine' button. But I would like it to happen automatically
Any Ideas?
Thanks
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
You can hook into the OnMouseOverMenu custom event to detect when hovering over an inventory item, and then run its Examine interaction:
Thank you for your response Chris,
Would you be able to point me in the direction of a tutorial on how to 'Hook into' custom events?
I come from an animation background so have zero coding knowledge. Sorry!
I linked the "custom event" above to a tutorial, but the code I wrote should also do it - though you may have to rename the "Inventory" menu string.
See also the Manual's "Custom events" chapter for further explanation.
HI Chris. I added this script to the GameEngine Object but when I try to run, I get the error:
Unexpected symbol
void', expecting
class',delegate',
enum',interface',
partial', or `struct'any Ideas?
https://imgur.com/a/c5E4TFw
Don't overwrite the default C# code with that - it goes inside the script itself.
Create a new C# script, remove the default Start / Update functions, and insert the code above where they used to be.