If I have a blob shadow projector directly above my player object, and therefore the shadow directly below it, it works fine. But I want the sun to be not directly overhead but fixed at a slight angle. If the shadow projector is at an angle and parented to the player object, the blob shadow stays at that same relative angle and rotates around with the player object; not the effect I was looking for. I'm trying to make it follow the position but not the rotation.
Don't use parenting, but instead use a script that makes one object follow another object without rotating:
var objectToFollow : Transform;
var offset : Vector3;
function Update () {
transform.position = objectToFollow.position + offset;
}
I have an alternative suggestion (and it will probably seem quite unusual) that uses parenting and will regrettably give you one extra game object, but it saves you from having to code at all.
If you create a new game object, call it, say, “Player Host” or something similar. Place the player object inside of this object at (0, 0, 0), then the object you want to follow it inside with it also. Now make your player move movement scripts target the host object, and the rotation scripts target the player object.
It’s a bit convoluted but it will save you headaches in the long run. This theory can be applied in many situations, say if you wanted to make a planetarium.