Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class schleimschuss : MonoBehaviour {
- public GameObject schleimbällePrefab;
- public Transform spawnPoint;
- private bool isAttacking = false;
- public int zuLetztSchadenBekommen = 5 ;
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- if (!isAttacking && Time.time >= zuLetztSchadenBekommen)
- if (Time.time = 5) {
- zuLetztSchadenBekommen = Time.time;
- isAttacking = true;
- }
- }
- }
- void FixedUpdate(){
- if (isAttacking) {
- GameObject schleimBall = (GameObject)Instantiate (schleimbällePrefab, spawnPoint.position, Quaternion.identity);
- schleimBall.GetComponent<Rigidbody2D>().AddForce(Vector3.right * 550);
- isAttacking = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement