hello , i am getting an error "unexpected symbol anim" in playermovement .cs please tell me how to fix this

script that have error "unexpected symbol anim

using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
	public float SPEED = 6F;

	Vector3 MOVEMENT;
	Animator ANIM;
	Rigidbody PLAYERRIGIDBODY;
	int FLOORMASK;
	float CAMRAYLENGTH = 100F;

	void AWAKE()
	{
		FLOORMASK = LAYERMASK.GETMASK ("FLOOR");
		AMIN = GETCOMPONENT <Animator> ();
		PLAYERRIGIDBODY = GETCOMPONENT<Rigidbody> ();
	}

	void FIXEDUPDATE()
	{
		float H = Input.GETAXISRAW ("HORIZONTAL");
		float V = Input.GetAxisRaw ("VERTICAL");

		MOVE (H, V);
		TURNING ();
		ANIMATING (H, V);
	}

	void MOVE (FLOAT H, float V)
	{
		MOVEMENT.SET (H, 0F, V);

		MOVEMENT = MOVEMENT.normalized * SPEED * Time.DELTATIME;

		PLAYERRIGIDBODY.MovePosition (Transform.POSITION + MOVEMENT);
	}

	void TURNING()
	{
		Ray CAMRAY = Camera.main.ScreenPointToRay (Input.mousePosition);

		RaycastHit FLOORHIT;

		if(PHYSICS.RAYCAST (CAMRAY, out FLOORHIT, CAMRAYLENGTH,FLOORMASK))
		{
			Vector3 PLAYERTOMOUSE = FLOORHIT.point - Transform.POSITION;
			PLAYERTOMOUSE.y = 0F;

			Quaternion NEWROTATION = Quaternion.LookRotation (PLAYERTOMOUSE);
			PLAYERRIGIDBODY.MoveRotation (NEWROTATION);
        }
	}
	void ANIMATING(float H, float V)
	{
		BOOL WALKING = H != 0F || V != 0F
		ANIM.SETBOOL ("ISWALKING", WALKING)
	}

1 Answer

1

You have a lot of upper case symbols in your code. C# is case sensitive, meaning BOOL is not the same as bool, RAYCAST is not the same as Raycast, and so on. You’ll need to fix the case of pretty much everything in your code to get it to compile.

Looks like you missed LayerMask.GetMask. Also, the error message you get should indicate the line the error is on. You can double click it in the console to go directly to the line that's in error. Also, you're missing semicolons at the end of lines 50 and 51. If you're having trouble with these basic programming things, I would suggest you find a good programming tutorial and learn C#. I mean really learn it. Practice it outside of game programming. It will only make your game programming easier and less frustrating.

Really? I said you're missing a semicolon on lines 50 and 51. Looks like you fixed one of them - I'll let you figure out which one you didn't fix. Seriously, you need to do some programming tutorials. You're not going to find many people willing to walk you through fixing the most basic of programming errors.

finnaly after long work of 18 hour i just fixed it it has only bit of mistake i just forgot semi colon in v!+07

If my answer helped, please check the checkmark to the left of my answer to select it as solving your question.