Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by shiroto

Hi, I have a rather simple problem, but couldn't find the answer, so I ask here: how can I check the class of an object?
I imagine something like: myobject.instanceOf(classname)
Is there a mechanism to achieve that in impact?

1 decade ago by dominic

Yep, you can use JavaScript&039;s #instanceof operator:
if( someEntity instanceof EntityPlayer ) { ... }
Page 1 of 1
« first « previous next › last »