Removes an Instance from the executor’s instance cache so the next access to it returns a new value.
The executor caches the Lua value handed back for each engine Instance, so repeated access to the same object returns the same value. cache.invalidate removes instance from that cache; the game object is not modified. The next time the engine hands that object to Lua, the access produces a new value instead of the one held before.
Parameters
Returns
void
Example
A game script caches a service reference and later checks whatever it is handed against that saved value. Keep your own working handle with cloneref, then cache.invalidate the service so the script’s next fetch is a different Lua value than the one it stored.
Useful when testing object deletion, recreation, or bypassing anti-cheat wrapper caching.