using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerScript : MonoBehaviour
{
public float speed = 30;
public float xMin, xMax, zMin, zMax;
Rigidbody ship;
void Start()
{
ship = GetComponent<Rigidbody>();
//ship.velocity = new Vector3(15, 0, 10);
}
void Update()
{
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
float clampedX = Mathf.Clamp(ship.position.x, xMin, xMax);
float clampedZ = Mathf.Clamp(ship.position.z, zMin, zMax);
ship.velocity = new Vector3(moveHorizontal, 0, moveVertical)*speed;
ship.position = new Vector3(clampedX, 0, clampedZ);
ship.rotation = new Quaternion.Euler(30, 0, -12);
}
}
Мне в этом коде выдает ошибку, не знаю как решить:
The type name "Euler" dos not exist in the type "Quaternion"