Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class PlayerControllerX : MonoBehaviour
- {
- public float speed = 15.0f;
- public float rotationSpeed = 300.0f;
- public float verticalInput = 1000.0f;
- // Start is called before the first frame update
- void Start()
- {
- }
- // Update is called once per frame
- void FixedUpdate()
- {
- // get the user's vertical input
- verticalInput = Input.GetAxis("Vertical");
- // move the plane forward at a constant rate
- transform.Translate(Vector3.forward * speed * Time.deltaTime);
- // tilt the plane up/down based on up/down arrow keys
- transform.Rotate(Vector3.right * rotationSpeed * Time.deltaTime * verticalInput);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement