Forum rules - please read before posting.

How to handle inventory cursors in VR mode?

Hi Chris,

In Unity's VR mode (e.g., running an Oculus Rift), there's no mouse cursor. This means AC never displays a cursor. This only applies to VR builds; when playing in VR mode in the Unity editor, there's still a mouse cursor.

So far, this has been fine for the project I'm working on. The designers haven't wanted a visible cursor. If the player is using a mouse, we use a non-AC, simulated world space cursor that's shown only on the Unity UI world space canvas menu. If the player is using a joystick, they can navigate the menu just like in non-VR mode. 

But now the designers are contemplating some puzzles where, if this were non-VR mode, the player would select an item in the inventory to change the mouse cursor to the item's cursor icon. Then the player would point this at the target in the scene and click to apply it to the target. 

In VR mode, the player can't see the item cursor, so they don't know whether they've selected or deselected the item in the InventoryBox. We lock the cursor in the center during play, so if they've selected the item they can still center the target on the screen to apply the item. They just can't see the item cursor.

Previous puzzles have opened a custom inventory menu when clicking on the target's hotspot. For example, imagine a hotspot on a lock. When the player triggers the hotspot, it opens an inventory menu from which the player can select one of the keys in his inventory. Upon selection, the menu closes immediately and the game tries to apply the selected key to the lock.

I may just suggest that they continue with this method of interaction.

Or is there some solution that I'm not thinking of? If not, may I put in a feature request to just show the cursor icon in the center of the screen in the absence of a mouse?

Comments

  • Sorry, it was a late night and I wasn't clear at all.

    The problem is that, in VR mode, hardware mouse cursors, immediate mode GUI (e.g., GUI.DrawTexture), and Screen Space - Overlay Canvases are not visible. Since AC draws the mouse cursor using hardware or GUI.DrawTexture, the cursor isn't visible.

    Would it be possible to perhaps add an option to draw it on a Screen Space - Camera Canvas?

    I'm not sure that the designers are going to end up needing it after all, but I thought I'd at least follow up with some clearer information than my previous post.
  • When it comes to VR, I would think that the more control the designers have over the cursor's display, the better - as people are still figuring out how best to do this all.  I could see if it's possible to include a function that returns the "intended" cursor as a texture, however.

    Beyond that, you have a couple of options:

    1) Create an InventoryBox that's Inventory box type property is set to Display Selected.  This will allow you to show the active inventory item without the need for a cursor.

    2) Read the selected inventory item through script with AC.KickStarter.runtimeInventory.selectedItem.
  • Thanks, Chris! I knew you'd have some great suggestions. I'm glad I didn't just go stomping into the code without a map. :-)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.