Rotate object with shadows

I have an object that casts shadows on the ground. What should i write if i want it to move with the shadows because if i write something like :

transform.Rotate(0, Time.deltaTime, 0);

my shadows are not moving with the object.

How are you creating the shadows?

You have basically 3 options:

  • Dynamic Shadows - with Unity Pro only. You shouldnt need to do anything
  • Baked Shadows - done via baking lightmapping. These dont move…ever.
  • Projected Shadow - done by having a projector that projects the shadow

If its a projected shadow, just ensure your shadow projector is attached to your object. When your object moves, your shadow will move also. ie make the projector a child of the object.