Assets\Scripts\MovePlayer.cs(22,41): error CS0117: 'Quaternion' does not contain a definition for 'Rotation' using System.Collections; using System.Collections.Generic; using UnityEngine;
public class MovePlayer : MonoBehaviour { private Rigidbody rb; public float speed = 0.5f; private Vector3 moveVector; public Rigidbody Rb { get => rb; set => rb = value; }
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MovePlayer : MonoBehaviour
{
private Rigidbody rb;
public float speed = 0.5f;
private Vector3 moveVector;
public Rigidbody Rb { get => rb; set => rb = value; }
void Awake()
{
rb = GetComponent<Rigidbody>();
}
void Update()
{
moveVector.x = Input.GetAxis("Horizontal");
moveVector.z = Input.GetAxis("Vertical");
rb.MovePosition(rb.position + moveVector * speed * Time.deltaTime);
transform.rotation = Quaternion.Rotation(Camera.main.transform.forward, Camera.main.transform.up);
}
}