Inventory Inspector

The_Vanishing_of_Ethan_Carter_ChurchEdgePhotogrammetryShotEthan Carter

Yesterday I played through the quite amazing The Vanishing of Ethan Carter. It is an exciting expertly crafted open world exploration adventure game with an interesting story (a bit of a let-down at the end but forgiven).

What really makes it stand out is its use of a technique called photogrammetry. With that they are able to produce amazingly detailed landscapes and objects. I often walked through the game in awe looking at all the many details. On the right you find two screenshots I pulled from the blog above.

Inspector

One thing I also liked about the game was a screen that came up every time you take an object. It will allow you to inspect that object and turn it with your mouse.carter_inv2carter_inv1

Do-It-Yourself

So my quest for today was to build that experience with AC into my adventure game. It took me several attempts to get the setup right, struggling with UI canvases, world-space, AC camera switch actions and some more. I think now I have quite a cool and generic setup that is now automatically appearing whenever I pick something up.

inv_inspectorI created a new Unity UI canvas in world-space, put a transparent image on it, a camera with depth 100 and only depth clearance, a spotlight and marked the whole background as a button. Then I created a new AC menu with that prefab, appear manually, wire the button to the menu close action.

One difficulty part was to propagate the object from one action list to another. After some experimenting I used a simple trick for that in the end. I added to my parameterized TakeItem action list one action to re-parent the object I am taking to a temporary well-known object that is always in the scene and in the TurnOn action list of the menu I re-parent that well-known object to my menu.

When the menu is turned on, the depth 100 camera will now draw on top of the screen letting the original camera shine through. AC will take care of pausing the game in the background. Using a script with unscaledDeltaTime I can still react to the mouse and rotate the object. Awesome!

Leave a Reply

Your email address will not be published.