Forum rules - please read before posting.

Aging Items

edited September 2018 in Technical Q&A
Figured out how to age items - and thought i'd share with the community. Somebody else may find this useful.

Unity 2018.2.7f1 - AC 1.64.5

Video of item aging if left, and then the item aging after being picked up.



The persistent timed action:
image

Parameters:
Wait time - This is how long to wait before performing the actions.
Persistent - This stops the timer from halting between scenes
Item - This is the inventory item in its default state
Replacement Item - This is the inventory item to change to after the specified time
Hotspot - This is the scene based Hotspot for the item
Replacement Hotspot - This is the Hotspot to change to after the specified time.

Logic:
Wait for {wait time} seconds.
Check whether we have picked up the {item}. 
If it has been picked up - Replace the {item} with {replacement item}
If it hasn't been picked up - Replace the {hotspot} with {replacement hotspot}

How its launched from the scene:

This is tagged to the end of an action list that toasts a slice of bread.

It should wait for 5 seconds, then if I have picked up the "slice of toast", it is replaced with "slice of cold toast".
If I haven't picked up the "slice of toast", it replaces "toast" (hotspot) with "toast (cold)" (hotspot).

Pre-Requisites:
Make sure that any aged GameObjects are disabled on startup of the scene.

If you haven't already got the persistent timers that survive scene changes, check out this thread that shows you how to make them:
https://www.adventurecreator.org/forum/discussion/7994/timers-global-or-local#latest




I hope somebody finds this useful. Feel free to comment or ask any questions. If people like this sort of sharing, i'll carry on sharing things. 

Thanks
Kev

Comments

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.