Guest User

Untitled

a guest
Apr 20th, 2014
55
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using UnityEngine;
  3. using System.Collections;
  4.  
  5. public class Option : MonoBehaviour
  6. {
  7.     private Transform _playerTransform;
  8.     private float     _distanceFromPlayer = 2;
  9.     private Vector3   _inFrontOfPlayerPos;
  10.  
  11.  
  12.     void Start ()
  13.     {
  14.         _playerTransform = GameObject.Find("Player").transform;
  15.     }
  16.    
  17.     void Update ()
  18.     {
  19.         // Constantly rotate
  20.         this.transform.Rotate(new Vector3(0, 50, 0) * Time.deltaTime);
  21.     }
  22.  
  23.     void FixedUpdate()
  24.     {
  25.         if (Input.GetButton("FireOption_Main"))
  26.         {
  27.             const float pushForce = 2000f;
  28.             rigidbody.AddForce(this.transform.forward * pushForce);
  29.             Debug.Log("Shoot Option");
  30.         }
  31.     }
  32.  
  33. }
RAW Paste Data