Callback when object becomes shadowed?
My gaming simulation shows shadowing just fine but I'd like to execute a callback (or provide some non-visual feedback) of when one object is casting any portion of its shadow (from the sun) upon another.
The Collider API has OnCollision*
messages. Wondering if there is any sort of OnShadow*
message.
Comment
Short answer: no, there is nothing like that.
And for good reason. Shadows are rendered by the GPU and optimal rendering architecture has no place for callbacks there.
If you need this for gameplay reasons then you need to need to figure out your own system that approximates this.