[SCRIPT] How do i get entityID outside click function


#1

How to get entity ID outside function ?

I need the entityid as soon the script start to run. But this is not working.

(function(){ 
  var  Ent = entityID;    
})

How do i get the entity ID, without a click event ?


#2

@Richardus.Raymaker perhaps this is what you’re looking for: http://jsref.docs.highfidelity.com/docs/clickdownonentityentityitemid-mouseevent


#3

It’s a strange hack to get entity id globel. but it seems to work. except playing sounds in wronmg way is screwing things complete with 5029.


#4

@Richardus.Raymaker the ‘preload’ method of an entity gets the entity id as soon as the entity is ‘seen’ by a user. so something like

(function(){ 
  var thisEntityID;
 this.preload=function(entityID){ thisEntityID = entityID}
})

#5

Thanks, that works. Would be nice if this where on the docs page. We really need a wiki.


#6

We have one.

but I just tried to create an account and it takes me to a blank white page…

@Honeybuzzer

are you aware of this?


#7

But, that’s old topic.
@Caitlyn talked last meeting about that High Fidelity is getting a Wiki.
And that’s all i know. Waiting for more info.


#8

Spaceships and aliens. Forget I said anything. :wink:


#9

wow i did a search of the docs site for ‘preload’ - you’re right that’s totally undocumented… :frowning2: i’ll see what i can do about that