A simple "my.shadow = on;" instruction in the action or function that is assigned to an entity should do the trick.