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 YAxisMovement : MonoBehaviour {
- public float Thrust;
- public Rigidbody RB;
- void Start()
- {
- RB = GetComponent<Rigidbody>();
- }
- void Update()
- {
- if (Input.GetKeyDown(KeyCode.B))
- {
- RB.AddForce(transform.up * Thrust);
- }
- else
- {
- Thrust = 900.0f;
- }
- }
- }
- // needs to follow the playercontroller for x and z
- // player controller needs to follow it for the y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement