using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Security.Cryptography;
using System.Xml.Xsl;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEngine.WSA;
public class Playermove : MonoBehaviour
{
public Transform camera;
public Rigidbody rb;
public float CamRotationSpeed = 5f;
public float cameraMinimumY = -60f;
public float cameraMaximumY = 75f;
public float RotationSmoothSpeed = 10f;
public float walkSpeed = 9f;
public float runSpeed = 14f;
public float maxSpeed = 20f;
public float jumpPower = 30f;
public float extragravity = 45;
float bodyRotationX;
float camRotationY;
Vector3 directionIntentX;
Vector3 directionIntentY;
float speed;
public bool grounded;
void Update()
{
lookRotation();
}
void lookRotation()
{
UnityEngine.Cursor.visible = false;
UnityEngine.Cursor.lockState = CursorLockMode.Locked;
// Rotation Values in Unity
bodyRotationX += Input.GetAxis("Mouse X") * CamRotationSpeed;
camRotationY += Input.GetAxis("Mouse Y") * CamRotationSpeed;
// Stop Camera Rotation 360
camRotationY = Mathf.Clamp(camRotationY, cameraMinimumY, cameraMaximumY);
// Create Rotation Target
Quaternion camTargetRotation = Quaternion.Euler(-camRotationY, 0, 0);
Quaternion bodyTargetRotation = Quaternion.Euler(0, bodyRotationX, 0);
//Handle Rotate
transform.rotation = Quaternion.Lerp(transform.rotation, bodyTargetRotation, Time.deltaTime = RotationSmoothSpeed);
camera.localRotation = Quaternion.Lerp(camera.localRotation, camTargetRotation, Time.deltaTime = RotationSmoothSpeed);
}
}
Error CS0200 Property or indexer ‘Time.deltaTime’ cannot be assigned to – it is read only
And at the start has an issue with the
Warning CS0108 ‘Playermove.camera’ hides inherited member ‘Component.camera’. Use the new keyword if hiding was intended
Not sure what im doing wrong here, I just started with C# today so i have literally Zero Experience and am trying to learn the basics, This is genuinely Confusing