Pouvez-vous m'aider a faire réapparaitre ses deux variables ?
Code : Tout sélectionner
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerControler : MonoBehaviour
{
private float speed = 20;
private float turnSpeed;
private float horizontalInput;
private float forwardInput;
// Start is called before the first frame update
void Start()
{
}
void Update()
{
horizontalInput = Input.GetAxis("Horizontal");
forwardInput = Input.GetAxis("Vertical");
transform.Translate(Vector3.forward * Time.deltaTime * speed * forwardInput) ;
transform.Rotate(Vector3.up, turnSpeed * horizontalInput * Time.deltaTime);
}
}
/code]