Hej, mam pytanko, mam void Update() gdzie wpisuje warunek
void Update()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
{
print("Abc");
}}
To po naciśnieciu strzałki w górę warunek się spełnia
Teraz mam drugi warunek on już jest w void OnTriggerEnter2D(Collider2D other)
void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.tag == "Cursor" )
{
print("123");
}
}
gdy dotykam obiekt o obiekt to warunek też się spełnia,
To jak połączyć te dwa warunki w jedno oczywiście patrząc że Input.GetKeyDown musi być w void Uptade
Dziękuję za wszystkie odpowiedzi i pomoce :)
Dodaje cały kod
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()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
{
print("Abc");
}
}
void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.tag == "Cursor" )
{
print("123");
}
}
}