Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class LightingBullet : MonoBehaviour
- {
- void Update()
- {
- transform.position += direction * speed * Time.deltaTime; //���������� ���� �� ����������� �� ������
- timer += Time.deltaTime;
- if(timer>lifeTime)
- Destroy(this.gameObject);
- }
- public void setDirection(Vector3 dir)
- {
- direction = dir;
- }
- private void OnTriggerEnter(Collider other)
- {
- if (other.CompareTag("Player"))
- {
- Debug.Log("collided");
- FindObjectOfType<PlayerController>().Damage(-damage);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement