Lerpz Animation, Not Connected??

I Set the Third Person Player Animation (Script) to The Player Tab and when i click the “play” button, the screen zooms onto Lerpz but i can’t control him, just the camera of the screen
This is the error message that comes up:

MissingComponentException: There is no ‘Animation’ attached to the “Player” game object, but a script is trying to access it.
You probably need to add a Animation to the game object “Player”. Or your script needs to check if the component is attached before using it.
ThirdPersonPlayerAnimation.Update () (at Assets/Scripts/Player/ThirdPersonPlayerAnimation.js:69)

I checked line 69 of the script but all it showed was a { .
Could anyone tell me how to fix this?

Ah I wish someone would update that tutorial, some parts of it just seem out of date nowadays. But anyways… the error you received was not necessarily because of your script, while it did encounter an error it was not because it wasn’t functioning correctly but rather it was looking for something that did not exist (See Dependencies in the blue box on page 16 of the tutorial). The ThirdPersonAnimation component depends on a component of type Animation to work and according to the error you received, there is no Animation component on the player. Now I believe that the Lerpz prefab you should have drug into your level at the start of the tutorial has an Animation component already attached to it, if not then the ThirdPersonAnimation component you added should have added one for you or there is something wrong with the assets you downloaded for the tutorial. I can’t really answer in detail what’s wrong without knowing a few more details however. First, did you in fact drag the Lerpz prefab from the project window into your scene? Second, did you download the Lerpz tutorial from Unity’s website or somewhere else? Finally, does your Player have an animation component attached (click your player in the Hierarchy view then look for it in the inspector)? Oh and one final side note, you are probably wondering why the error message you received was pointing to a specific line in a specific script… well whenever a script encounters a problem an error is logged with unity, the line # is simply an indication to the specific part of the code which encountered a problem, be it a problem in the script such as syntax or a problem the script encountered. In your case the error points to a specific block of code where the script encountered a problem starting at line 69 and ending somewhere else the “{” and its partner “}” indicate a block of code. Sorry if what I said seems either too complicated or too basic, I’m trying to give you all the information I can.

-Help was very appreciated Charles-

  1. I dragged the Lerpz prefab to the Hierarchy

  2. I downloaded the Lerpz prefab from the Unity Sites Tutorial

  3. When i play the game the Camera Zooms in from far onto Lerpz then instead of controlling Lerpz himself, i control the camera. The capsule collider is well placed at 1.03 “y” around Lerpz.

  4. Here is the Script at 69:

    	{
    		ApplyPositionDamping (Vector3(targetCenter.x, targetHeight, targetCenter.z));
    	}
    	
    	SetUpRotation(targetCenter, targetHead);
    }
    
    function ApplySnapping (targetCenter : Vector3)
    {
    	var position = transform.position;
    	var offset = position - targetCenter;
    	offset.y = 0;
    	var currentDistance = offset.magnitude;
    
    	var targetAngle = target.eulerAngles.y;
    	var currentAngle = transform.eulerAngles.y;
    
    	currentAngle = Mathf.SmoothDampAngle(currentAngle, targetAngle, velocity.x, snapLag);
    	currentDistance = Mathf.SmoothDamp(currentDistance, distance, velocity.z, snapLag);
    
    	var newPosition = targetCenter;
    	newPosition += Quaternion.Euler(0, currentAngle, 0) * Vector3.back * currentDistance;
    
    	newPosition.y = Mathf.SmoothDamp (position.y, targetCenter.y + height, velocity.y, smoothLag, maxSpeed);
    
    	newPosition = AdjustLineOfSight(newPosition, targetCenter);
    	
    	transform.position = newPosition;
    	
    	// We are close to the target, so we can stop snapping now!
    	if (AngleDistance (currentAngle, targetAngle) < 3.0)
    	{
    		isSnapping = false;
    		velocity = Vector3.zero;
    	}
    }
    

Do you think there might be a problem with the target height?
Anyway i hope this helps

I had the exactly same issue. I recreated everything and followed the tutorial again. And found in one of the images did it exists Animation in the Inspector for the Player object.
Which I didn’t have in my Inspector. So I just added a Animation from Add Component. But still got a lot of errors. I Clicked on the circle between walk, and clicked on all animations.
And tried to run. Now didn’t I get any more errors. But I still can’t control the player. Which is there I’m stuck now.

^ Used wrong method.

Edit: Looks like I have been changing the Child instead of the Root Object.