Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Error CS1525 and Error 8025

$
0
0
Please help me ! error CS1525 :Unexpected symbol '}' error CS8025:Parsing error Make a FPS game and give me error in PlayerMotor.cs using UnityEngine; [RequireComponent(typeof(Rigidbody))] public class PlayerMotor : MonoBehaviour { [SerializeField] private Camera cam; private Vector3 velocity = Vector3.zero; private Vector3 rotation = Vector3.zero; private Vector3 cameraRotation = Vector3.zero; private Vector3 thrusterForce = Vector3.zero; private Rigidbody rb; void Start () { rb = GetComponent(); } // Gets a movement vector public void Move(Vector3 _velocity) { velocity = _velocity; } // Gets a rotational vector public void Rotate(Vector3 _rotation) { rotation = _rotation; } // Gets a rotational vector for the camera public void RotateCamera(Vector3 _cameraRotation) { cameraRotation = _cameraRotation; } //Gets a force vector for our thrusters public void ApplyThruster (Vector3 _thrusterForce) { thrusterForce = _thrusterForce; } //Run every physics iteration void FixedUpdate () { PerformMovement(); PerformRotation(); } //Perform movement based on velocity variable void PerformMovement () { if (velocity != Vector3.zero) { rb.MovePosition(rb.position + velocity * Time.fixedDeltaTime); } if (thrusterForce != Vector3.zero) { rb.AddForce(thrusterForce * Time.fixedDeltaTime, ForceMode.Acceleration) } } //Perform rotation void PerformRotation () { rb.MoveRotation(rb.rotation * Quaternion.Euler(rotation)); if (cam != null) { cam.transform.Rotate(-cameraRotation); } } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>