Answer the question
In order to leave comments, you need to log in
How to fix error CS0426?
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"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question