Shadow Projector Component not pointed down

Hi all,

I am trying to get drop shadows on my prefab characters. I’ve already imported Blob Shadow et al from Standard Assets.

I have 10 characters running around at once, so I attached a Projector component to the character’s prefab, then gave it the shadow material. Unfortunately, it’s pointed straight out, instead of down!

When I go into an update routine and try this:

var proj : Projector = GetComponent (Projector);
proj.transform.rotation.eulerAngles.x = 90;

It rotates the parent object! (which is not a Projector, BTW. =D )

I tested to see if there was a transform on the projector using this line of code:

if (proj.transform == null) print("null");

But it never printed, making me think it does have a transform.

So… if you know of a different way to get a standard blob on multiple characters, or know what I’m doing wrong here, please let me know!

Thank you!

The Projector is a component on a GameObject. The GameObject has a Transform. Components do not themselves have a Transform. Look in the Inspector and this will become clear.

If you only want to rotate the Projector and not the whole GameObject it is on, then put it on a child of that game object and rotate the transform of that child object.

To make a child object, Create Empty and drag it to the parent object.