So I’m really new to unity and I’ve been making a Platformer, and I want the Player to die when he touches the Blue Jelly named “Death”. I’ve looked around forums, videos, and tried to fix it myself for atleast 4 hours… But I cant find a fix! - Here is my code:
void OnCollisionEnter(Collision col) {
if(col.gameObject.name == "Jelly")
{
Destroy(col.gameObject);
I cant find any code for it to respawn without there being errors. From this code I get quite a few error messages:
error CS8025: Parsing error
error CS1519: Unexpected symbol `’ in class, struct, or interface member declaration
error CS1520: Class, struct, or interface method must have a return type
error CS1041: Identifier expected
Unexpected symbol `==’ in class, struct, or interface member declaration
Unexpected symbol `if’ in class, struct, or interface member declaration
Could anyone help me to get this code fixed and make it so my player can respawn?