|
I didn't want my player's blob shadow to look directly down at him, so I put the projector at the same position as the light and used LookAt to make it look more real, but it twitches out. It randomly looks downward. The player makes particles and has a character controller. I don't know if those would effect any thing, because I'm new to Unity.
(comments are locked)
|
|
I turned on "Is Kinematic" on the Rigidbody Component to fix it.
(comments are locked)
|
|
I believe your problem is that you have put this in FixedUpdate (). FixedUpdate is framerate independent, as is explained here, and is called at fixed intervals as is defined at Edit > Project Settings > Time > Fixed Timestep. Its main purpose is for physics calculations, and unless it is absolutely necessary, should only ever be used for physics calculations. In short, your LookAt is twitching because it is running at intervals independent of the framerate. In order to run every frame and in this case, you would instead use Update (). Hope that helps, Klep Thanks, but I originally had the code in the normal Update and not FixedUpdate, but I tried it again anyways, and it still didn't work. It seems to only happen to the player object(and it's child objects), but it works with the other objects. It is still looking at the player, but it looks downward on the x axis a little, but not strait down.
Mar 11 '12 at 06:21 AM
G-rant
Hmm, I just tested this code and it works fine for me. The only aspects that were different were the fact that you are using a blob shadow projector and a rigidbody. Which raises the question, why are you using a rigidbody on your player? I presume that you are using the standard First Person Controller since you're using a Character Controller. Furthermore, why have you got it set to isKinematic? I'm not sure if this would have an effect on the blob shadow projector, seeing as I've never used it, but perhaps some more information would be helpful. Klep
Mar 11 '12 at 09:22 AM
Kleptomaniac
Putting it in Is Kinematic fixed the problem. I edited solved in the question name, but it didn't change.
Mar 11 '12 at 01:57 PM
G-rant
You don't put "solved" in the question title, you accept the answer by using the checkmark. (Currently editing is broken and it takes changes quite a while to show up.)
Mar 11 '12 at 01:59 PM
Eric5h5
Okey, but his answer wasn't what solved my problem.
Mar 11 '12 at 02:05 PM
G-rant
(comments are locked)
|
