Skip to content

Api > LuaBehaviour > OnBecameInvisible()


LuaBehaviour.OnBecameInvisible()⚓︎

OnBecameInvisible is called when the object is no longer visible by any camera.

Usage⚓︎

local script = LUA.script;

--- OnBecameInvisible message from LuaBehaviour

function script.OnBecameInvisible()
   -- 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.