christian.shiel Posted November 20, 2013 Posted November 20, 2013 I am creating a world with 1000s of moving entities. Are scripts running on non visible entities by default?
unclebob Posted November 22, 2013 Posted November 22, 2013 Hi Christian! Sorry for late reply. It depends on how you're using your scripts & nodes. Generally, there's no 'scripts on objects' feature, you usually write your code in world/system scripts. You can find additional info about where to put your code here: https://developer.unigine.com/en/docs/1.0/code/execution_sequence/code_update A few words about the most common use cases: 1) Custom logic in world/editor script: calls update function every frame, so you can do whatever you want (grabe & update every node in a world, skip nodes by criteria, etc.). It's really up tp you how 2) WorldExpression node attached to other node: calls its script every frame within expression's bounds (size parameter). Feel free to ask more! :)
christian.shiel Posted November 22, 2013 Author Posted November 22, 2013 Hi I guess what I mean then is, how can I tell if an object is being occluded? isVisible() ? Thanks
unclebob Posted November 25, 2013 Posted November 25, 2013 Hi Christian! There is no callbacks like 'onBecameVisible/onBecameInvisible', you have to handle it by yourself. It's simple, just check if object is within camera frustum.
Recommended Posts