Cześć mam problem gdyż wyświetla mi błąd w kodzie gdy chce aby funkcja sie spełniła to trzeba kolidować z obiektem i kliknąć klawisz w gorę, proszę o pomoc, dziekuje :D
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class aaa : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.tag == "Cursor") & (Input.GetKey("up"))
{
Destroy(gameObject);
}
}
}
Edit: gdy dodaje & (Input.GetKey("up") wtedy kod nie działa "Assets\Scripts\aaa.cs(21,69): error CS1002: ; expected"