Hello I am getting a "Cannot implictly convert type ‘UnityEngine.Quaternion’ to ‘UnityEngine.Vector3’ Error
Here is my code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerControls : MonoBehaviour
{
[SerializeField] float controlSpeed = 10f;
[SerializeField] float XRange = 10f;
[SerializeField] float YRange = 10f;
void Start()
{
}
void Update()
{
ProcessTranslation();
ProcessRotation();
}
void ProcessTranslation()
{
float xThrow = Input.GetAxis("Horizontal");
float yThrow = Input.GetAxis("Vertical");
float xOffset = xThrow * Time.deltaTime * controlSpeed;
float yOffest = yThrow * Time.deltaTime * controlSpeed;
float rawXpos = transform.localPosition.x + xOffset;
float rawYpos = transform.localPosition.y + yOffest;
float clampedXpos = Mathf.Clamp(rawXpos, -XRange, XRange);
float clampedYpos = Mathf.Clamp(rawYpos, -YRange, YRange);
transform.localPosition = new Vector3 (clampedXpos, clampedYpos, transform.localPosition.z);
}
void ProcessRotation()
{
transform.localPosition = Quaternion.Euler(-30f,30f,0f);
}
}
I cannot seem to find where the error is coming from.