Was wondering if I could get a small (big) bit of help…
Basically I am currently developing my Gui Menu system.
( Just literally 3 buttons )
Scene 1
Scene 2
Scene 3
I am using a look at input module for the DK2 whereby if i look at a button long enough - it will select that level and it will load.
Ive managed to do all that so far.
I am just looking at getting some feedback to the user so when they hover / look at a button a countdown timer will begin to animate… This is to show that the object they are looking at will create be selected.
I’ve inserted 2 images of what I mean… the curser stays the same on hover over and off… id just like to animate the curser when its hovering on for 3 seconds.
I don’t have any example code off the top of my head, but here’s how I would probably do it.
Inside your Cursor/ general ScriptManager class:
public GameObject countdownPrefab;
private Image countdownImage;
Awake(){
// Add OnPointerEnter callback to OnButtonFocussed() for each button. (Or, if you need this for every button, subclass it into a "LookButton" and have it register the callback instead)
// Do the same for the OnPointerExit event and OnButtonUnfocussed()
}
OnButtonFocussed(){
countdownImage = Instantiate(countdownPrefab) as Image;
// Set parent, position, etc.
}
OnButtonUnfocussed(){
Destroy(countdownImage);
countdownImage = null;
}
I would then add a new script called LookButtonCountdown or something to the countdown prefab that in its Update() sets its position to be near the cursor. Depending on the animation needed you can then also start the needed coroutines, or set the appropriate properties like radial fill, etc.