Skip to content

Api > LuaBehaviour > OnBecameVisible()


LuaBehaviour.OnBecameVisible()⚓︎

OnBecameVisible is called when the object became visible by any camera.

Usage⚓︎

local script = LUA.script;

--- OnBecameVisible message from LuaBehaviour

function script.OnBecameVisible()
   -- your code here 
end

Extra Detail⚓︎

This message is sent to all scripts attached to the renderer. OnBecameVisible and OnBecameInvisible are useful to avoid computations that are only necessary when the object is visible.