|
Ok, how can I make my blob shadow that was included with the unity package follow the player and not to rotate with it, I want it to follow the shape according to the terrain. How can I do that.
(comments are locked)
|
|
Ok I don't know how the hell that other script is supposed to function, but here's mine. The "5f" value affects how high above the ball the shadow projector is, you can change it to whatever you like, it affects how much the size of the shadow changes with distance from floor. Actually the commented out code is the original "transform.position = transform.parent.position + Vector3.up * 15f;" Make sure the projector is a child of the ball.
(comments are locked)
|
|
The easiest thing to do is just parent the player to the blob shadow. That is place the blob where you want it relative to your object, then make it a child of the object. Then whenever you move the character, the shadow will follow. Thaks but i wnat it to move the shadow with the player but not to rotate with it
Feb 04 '12 at 11:56 PM
BigBlob
(comments are locked)
|
|
I had exactly this problem, but I was able to put together a robust solution based on various community answers. I think it will work for you. Create a blob shadow projector (I think one comes in standard assets). Then slap this script on it. Once you point the variables to the player and the sun/light source in the inspector, it will work like a charm. // ShadowFollow.js #pragma strict var objectToFollow : Transform; // The object you need a shadow under var offset : Vector3; // How much to shift the projector from the object center var lightSource : Light; // What light is "casting" the shadow function Start () { } function Update () { }
(comments are locked)
|

what do you mean by follow it but not rotate with it. Do you want it to be vertically above the character looking down on it the whole time or... What?
Its becuase my character is rolling ball and if a shadow is a child of the ball then obviously it will rotate with it too