Привет, помогите пожалуйста с ошибкой. Не могу найти решение
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
private Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void Update()
{
if (Physics.Raycast(transform.position, Vector3.down, GetComponent<BoxCollider>().size.y / 2 + 0.4f))
{
Quaternion rot = transform.rotation;
rot.z = Mathf.Round(rot.z / 90) * 90;
transform.position = rot;
if (Input.GetMouseButtonDown(0)) {
rb.velocity = Vector3.zero;
rb.AddForce(Vector2.up * 55000);
}
}
else {
transform.Rotate(Vector3.back * 5f);
}
}
}
Error: Cannot implicitly convert type 'UnityEngine.Quaternion' to 'UnityEngine.Vector3'