Good day
So, I have this custom method in the script of my caption window:
method DisplayCaption
(var Text) {
for(var i=10; i>=1; i=i-1)
{
}
}
So when someone clicks a hotspot, I send some caption text to this method, and the window becomes visible, displays the caption text, waits 5 seconds, then fades out and becomes invisible again.
This works fine initially, but the problem is if a player clicks another hotspot, it just runs this method again, whilst the first instance is still running, which means the window always goes invisible after the first 5 seconds are up. Making sense? Good.
So, is there a way to cancel the first run through if a player clicks the same hotspot again or clicks a new hotspot, so that there is only ever one instance of this method executing at any one time?
Thanks.