Hi So I’m working on this Horror game and it’s not that big but I have some problems with the Player Script. I wanted some help on how I could make the player rotate.
Here’s my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Playermovement : MonoBehaviour {
public float moveSpeed;
// Use this for initialization
void Start()
{
moveSpeed = 15f;
}
// Update is called once per frame
void Update()
{
transform.Translate(moveSpeed*Input.GetAxis(“Horizontal”)Time.deltaTime,0f,moveSpeedInput.GetAxis(“Vertical”)*Time.deltaTime);
}
}
That tutorial is less than a year old. I assure you none of the things in that video have changed in Unity. I’ll be glad to help you further if you try it out and run into problems.
Okay so I did the rotation script and I’m now on the Key script but everytime I try to move with WASD it just flies up into the air
Here’s my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovementScript : MonoBehaviour
{
public CharacterController controller;
public float speed = 12f;
// Update is called once per frame
void Update()
{
float x = Input.GetAxis(“Horizontal”);
float z = Input.GetAxis(“Vertical”);
Vector3 move = transform.right * x + transform.forward * z;