I'm not sure if I am missing something obvious here, but I've been working with AC for a while now and this is the first time this issue came up. I've developed a menu that pops up when the player picks up an item. Basically a static heading (You have found a new item!!!), a text box that changes depending on the item (i.e. Remote Control) and a Graphic element to show the item sprite. I think I can change the text by using a dialog action, but how would I change the sprite to show in the Graphic element, depending on which item the player is picking up?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
There's a couple of ways you can do this:
The second way would be the cleanest. This technique is actually used by the "Chamber" demo game on the Downloads page. Here's an extract of the relevant code from its NewItemMenuSetup script:
Thanks Chris.
I'll give method 2 a go first, although I've tried my best to avoid scripting up to now. I've managed the first series of online tutorials, but they lost me when things became more complex.
The script above should do it. It works by updating the Graphic element supplied in its Inspector with the texture of the last item added to the inventory.