Respawn fix
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 <internal>' 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?
Answer by Tedeveloper · May 01, 2016 at 08:34 AM
I also get another error: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
Your answer
Follow this Question
Related Questions
How to disable a boxcollider2d temporary? 1 Answer
1 exception was raised by workers: See the Console for details. 1 Answer
Can someone please tell me whats wrong with this?, because when i put it says error in the GetAxis 1 Answer
Help me destroy anplayer when out of bounds. 2 Answers
Vuforia doesnt display anything on play mode, how do i fix this problem? 1 Answer