Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using UnityEngine;
- using System.Collections;
- public class Option : MonoBehaviour
- {
- private Transform _playerTransform;
- private float _distanceFromPlayer = 2;
- private Vector3 _inFrontOfPlayerPos;
- void Start ()
- {
- _playerTransform = GameObject.Find("Player").transform;
- }
- void Update ()
- {
- // Constantly rotate
- this.transform.Rotate(new Vector3(0, 50, 0) * Time.deltaTime);
- }
- void FixedUpdate()
- {
- if (Input.GetButton("FireOption_Main"))
- {
- const float pushForce = 2000f;
- rigidbody.AddForce(this.transform.forward * pushForce);
- Debug.Log("Shoot Option");
- }
- }
- }
RAW Paste Data