- Home /
Lerpz 3D Platform Tutorial character animation issue with Unity 3.4
UPDATE
Ok so I downloaded the 3D Platform Tutorial and had another go at it. I recorded the whole thing in a video. I got better results this time. Lerpz's walk animations actually kick in when I move him around but when he stands still his arms shoot up and down over and over again. Perhaps his fall animation is being called for some reason while he is standing still? Also I got no errors this time so I assume I followed the tutorial perfectly.
Here is the video:
http://www.youtube.com/watch?v=L4VF6TVPgj8
OLD POST
n Chapter 2 named First Steps of the 3d platform tutorial I can get as far as the Animating Lerpz section and then I hit a major error. Lerpz's animations will not kick in when I try moving him around. I have no idea what is going on. Here are two screen shots of the Inspector showing the Player and Near Camera objects (to prove I have the component scripts in the right place):
When I press play and move Lerpz around he just has his hands in the air and floats around. I made a video of it here at Youtube:
http://www.youtube.com/watch?v=KxEgy7q_koE
Additionally, I noticed I am getting two errors in the console. Here they are:
Line 21 of SpringFollowCamera.js has this code:
var characterController : CharacterController = target.collider;
Line 40 of SpringFollowCamera.js has this code:
var targetHead = target.position + headOffset;
Any ideas on what is going wrong and how to fix it?
Loosing faith in the tutorials Unity3d is providing.
Answer by mrdodson · Sep 01, 2011 at 10:37 PM
If you click on your NearCamera and look in the inspector you'll see that you have accidentally added 2 instances of the Spring Follow Camera script. The first one has its target set to the Player. The second one does not have a target set. That's why it seems like the camera is working (because the first instance moves toward the player) but the second instance throws a runtime error and probably nukes the game.
Ok I redid the tutorial and got the similar results with the animation problem. See the top of my post for update and video I made of my process.
This is just a guess, but I'm wondering if it has something to do with your capsule collider. I started this tutorial yesterday and found that when I enter the coordinates 0, 1.03, 0 that my capsule is off center from the character. There's another thread about it here: http://answers.unity3d.com/questions/56433/lerpz-tutorial-capsule-collider-offset-from-center.html Having the capsule offcenter works for me though. When I center it on my character weird stuff happens...not sure why or how to change the offsets that they mention in that thread..
To be honest, I wouldn't get too bent out of shape about it right now, these tutorials are from Unity 2 and I know a lot has changed since then and 3.4 so there are definitely some bugs (the jet pack settings in the tutorial have alpha values that are too low so your jet looks nothing like the pictures, for instance). I think when you get to the section that explains how it changes character animation state, you might be able to look at the script that's calling the fall animation and debug from there. Sorry I'm not more help, you and I are pretty much in the same place with these tuts :)
no you did help. i am going to go back and follow your advice. thanks for the heads up on the backpack too. i really wish Unity3d had one $$anonymous$$m member devoted to making sure all the tutorials are compatible with new versions of Unity3d. And if they are not compatible they should explain how to make them compatible. The official docs are also way out of date filled with irrelevant info. A newbie nightmare.
oh dear. i did not change the collider position and still see Lerpz quickly moving his arms up and down like he is flying. For some reason it is calling a frame of his fall animation.
Answer by roamcel · Aug 30, 2011 at 02:05 PM
I have not faced this error myself, but as the log reads: "you probably need to assign the target variable of the springfollowcamera script in the inspector". This might not mean much to you now, but it basically says that you need to drop the lerpz gameobject into the 'target' slot of the 'springfollowcamera' script attached to the camera, if I remember correctly.
Ok I redid the tutorial and got the similar results with the animation problem. See the top of my post for update and video I made of my process.
Your answer
Follow this Question
Related Questions
Unable to see platform(Unity Tutorial) 1 Answer
trouble getting started with 3D platformer tutorial 0 Answers
Lerpz LevelStatus script 4 Answers
Lerpz Adventure Tutorial - Start Menu 2 Answers
Lerpz Tutorials Animation Problem 0 Answers