Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class schleimschuss : MonoBehaviour {
  6. public GameObject schleimbällePrefab;
  7. public Transform spawnPoint;
  8. private bool isAttacking = false;
  9. public int zuLetztSchadenBekommen = 5 ;
  10. // Use this for initialization
  11. void Start () {
  12.  
  13. }
  14.  
  15. // Update is called once per frame
  16. void Update () {
  17. if (!isAttacking && Time.time >= zuLetztSchadenBekommen)
  18. if (Time.time = 5) {
  19. zuLetztSchadenBekommen = Time.time;
  20.  
  21. isAttacking = true;
  22. }
  23. }
  24.  
  25.  
  26.  
  27. }
  28. void FixedUpdate(){
  29.  
  30. if (isAttacking) {
  31.  
  32. GameObject schleimBall = (GameObject)Instantiate (schleimbällePrefab, spawnPoint.position, Quaternion.identity);
  33.  
  34. schleimBall.GetComponent<Rigidbody2D>().AddForce(Vector3.right * 550);
  35. isAttacking = false;
  36.  
  37.  
  38. }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement