Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question SteamInventory.StartPurchase doesn't show the purchase screen

Discussion in 'VR' started by Stranger-Games, Aug 1, 2022.

  1. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    393
    Hi,

    When I all SteamInventory.StartPurchase for micro transaction in game, the steam overlay window doesn't appear.
    The game is working fine under Steam VR in all things except that part.

    Thanks for advance.
     
  2. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    393
    I found the problem, didn't find the solution.

    OpenVR Loader wasn't checked, so steam vr never really launch or get connected when I run the game. That's why when I purchase something, the purchase window appear on the computer screen rather than VR.
    So I checked OpenVR Loader, but that immediately broke the xr rig and everything, because all interactions in the game is using openxr since the game is on several platforms including the quest.

    Is there a solution?
    Thanks for advance.

    upload_2022-8-1_21-49-4.png
     
  3. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    393
    Works by changing play mode openxr runtime to SteamVR
    =================
    Actually not solved, because play mode openxr runtime is only used in editor. The problem presists in build.
    I want to keep my xr rig and interaction working, but want the in app purchase to work correctly in steam vr.
     
    Last edited: Aug 2, 2022
  4. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    393
  5. homoinanis

    homoinanis

    Joined:
    Sep 29, 2020
    Posts:
    7
    The Steam documentation is really good, but there are some points that don't link quite right.

    When you need to perform an asynchronous operation that has to communicate with the Steam API INTERNALLY use Steam's "CallResult".
    However, when you need to perform an operation that requires the connection with an external element (such as the overlay to authorize a transaction) you have to use the "Callback".

    Here you can see how both work: https://steamworks.github.io/gettingstarted/