Hello Guys,
iam new to programming and i searched web and youtube for some answers, followed tutorial but somehow i get two issues.
I got a very easy script which, on collision, will change the scene to the game over scene. So far it worked but now i implemented flying enemys which go down diagonally and enter the killbox i have set up below my platforms.
So when they touch the killbox the game ends too, which is not as intended as it should only happen when the player touches is.
Problems:
FIRST: The Tags are not working, it does not care if i use the TAG “Player” or “Enemy”
SECOND: I thought of using an else block for doing nothing but everytime i do that it gives the error CS1513 } expected while i have set up all the brackets.
Again iam really new to programming, so i hope you can help me with this maybe easy problem.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class TrapScript : MonoBehaviour
{
void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == “Player”);
{
SceneManager.LoadScene(“GameOver”);
}
else
{
// do nothing
}
}
}