You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
354 B

  1. using UnityEngine;
  2. using System.Collections;
  3. public class P2_weapon : MonoBehaviour {
  4. // Use this for initialization
  5. void Start () {
  6. }
  7. void Update (){
  8. if (Input.GetKeyDown("space"))
  9. transform.Translate (Vector3.right);
  10. else if (Input.GetKeyUp("space"))
  11. transform.Translate (Vector3.left);
  12. }
  13. // Update is called once per frame
  14. }