Forum Discussion
my3dscene
11 years agoProtege
Select by looking something for a few seconds
Hi guys, at the moment I am working in Javascript to add this feature in my project. However I am having some issues. What I am doing is attach a non renderable stretched box to my right camera (...
my3dscene
11 years agoProtege
"MikeF" wrote:
you could do something like:
var LookingAtObject : bool = false;
var LookAtTimer : float = 0.0f;
var LookAtTimeLimit : float = 3.0f
function Update()
{
if (LookingAtObject == true){
LookAtTimer += time.deltaTime
}
if (LookAtTimer >= LookAtTimeLimit){
doSomething
}
}
function OnTriggerEnter (other : Collider) {
LookingAtObject = true;
}
function OnTriggerExit (other : Collider) {
LookingAtObject = false;
LookAtTimer = 0.0f;
}
I havent tested this but that should be the just of it
Tnks master mike, I will let you know how it works.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 9 months agoAnonymous
- 3 years ago