View Single Post
10-13-16, 10:55 PM   #8
Krainz
A Wyrmkin Dreamwalker
Join Date: Oct 2016
Posts: 57
Originally Posted by Torhal View Post
That's a slightly naive implementation, though; no matter what happens, the UI will be hidden after 3 seconds. This means you can stop moving, the 3 second timer will start. You start moving again, and the UI will still be hidden when the timer ends, despite the fact that you're actively moving.
That can be resolved through variables, can't it?


ie, when the player starts moving, the variable is set to 1. When the player stops moving, the variable is set to 0.

HideUI() checks the variable and only hides it when the value equals 0.

This way, if the player starts moving, it will register PLAYER_STARTED_MOVING, and then after 3 seconds it won't be able to hide the UI because the variable's value will be 1.

However, I don't know for sure if it will work that way and if it will, whether or not it will be a constantly checking script. Makes me think of the mouse position checker solution.
  Reply With Quote