Question by
SaiKumarchinna · Sep 14, 2016 at 01:22 PM ·
parsing error
Assests/scripts/player/playerMovement.cs(13,2): error cs8025: parsing error PLease fix this ..
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"); anim = GetComponent (); PlayerRigidBody = GetComponent (); } 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 (transfrom.position + Movement);
}
void Turning ()
{
Ray camRay = GetComponent<Camera>().main.ScreenpointToRay (Input.mouseposition);
RaycastHit floorHit;
if(Physics.Raycast (camRay, out floorHit,camRayLength, floorMask))
{
Vector3 playerToMouse = floorHit.point - transfrom.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);
}
}
Comment
$$anonymous$$aybe you're missing the type argument for GetComponent()? It needs to know what type to look for.
I usually do it along these lines:
GetComponent<$$anonymous$$yComponentType>();
Please can you put the whole script in code tags so that I can identify which line the error is on
Your answer
Follow this Question
Related Questions
Parsing error 0 Answers
Help! CS8025: Parsing Error pic included 2 Answers
Parsing error cs8025 C# 0 Answers
CS8025 Parsing Error 0 Answers
can anyone find my parsing error? 1 Answer