Advertisement
Guest User

Untitled

a guest
Aug 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Fumiko : MonoBehaviour {
  6.  
  7. public float upforce = 200f;
  8.  
  9. private bool isDead; = false;
  10. private Rigidbody2D rb2d;
  11.  
  12. // Use this for initialization
  13. void Start ()
  14. {
  15. rb2d = GetComponent<Rigidbody2D> ();
  16. }
  17.  
  18. // Update is called once per frame
  19. void Update ()
  20. {
  21. if (isDead == false)
  22. {
  23. if (Input.GetMouseButtonDown (0))
  24. {
  25. rb2d.velocity = Vector2.zero;
  26. rb2d.AddForce(new Vector2(0, upforce));
  27. }
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement