So, I have had trouble with this and can not find a valid solution, can anyone help with the code? the trouble is that when I rotate, the controls don’t update with the rotation so if I turn around, the controls are “S” to go forward, “W” for backward, “A” for right, and “D” for left. controls are swapped!
here’s my code.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
public float runSpeed = 5f;
public float speedH = 2f;
public float speedV = 2f;
private float yaw = 0.0f;
private float pitch = 0.0f;
// Start is called before the first frame update
void Start()
{
runSpeed = 5f;
}
// Update is called once per frame
void Update()
{
transform.Translate(runSpeed * Input.GetAxis(“Horizontal”) * Time.deltaTime, 0f, runSpeed * Input.GetAxis(“Vertical”) * Time.deltaTime, 0f);
yaw += speedH * Input.GetAxis(“Mouse X”);
pitch -= speedV * Input.GetAxis(“Mouse Y”);
transform.eulerAngles = new Vector3(pitch, yaw, 0.0f);
}
}
Yes. Downgrade isn’t supported. You probably will have a bunch of errors.
Obviously it’s your decision to use an alpha software to develop or not, but you will have more problems with it since it is not intended for production yet. That’s why it is alpha build. If you can you should try to recreate your project in 2018.4 or 2019.1 (if you really want it, it’s mostly stable, but for beginners the LTS (.4) versions are better)