- Home /
Projector Position Wont Move (Attached to Parent)
I've parented a Projector to an object that moves(rigidbody) but it will not update its transform when the parent moves.
I have even attached a script and used the parent as a reference to assign the transform position directly and it still will not move.
I am using the latest Free version.
Answer by sh0v0r · Dec 04, 2010 at 02:28 AM
I've found a solution although I don't know why parenting didn't work like everything else?
Instead I've written a Shadow script that I attach to the object which has a public transform field called shadow.
The projector is assigned to the shadow field.
public class Shadow : MonoBehaviour
{
public Transform shadow; public float yOffset;
void Update() { shadow.transform.position = new Vector3(transform.position.x, transform.position.y + yOffset, transform.position.z); }
}
rather than parenting the blob shadow object (from the Projectors package), i just made it a top-level object, then assigned the reference to its transform to your script. works like a charm :)
Your answer
Follow this Question
Related Questions
Weird Lines When Using Projector Unity 2020.3 0 Answers
make a projector map 1 Answer
Keeping a Constant Z Position 3 Answers
Projector not working on parts of imported Blender mesh. 0 Answers