|
This is a script I'm working on for a school project. I've been trying to make a script that will respawn my character after they reach a certain point in my game...I've just can't get this to work. This is my first time posting and basically first time scripting for Unity. Here is my script.
Thanks a bunch. Daniel
(comments are locked)
|
|
hit.gameObject == "DEATHZONE" looks very suspicious. Did you mean by 'name of DEATHZONE'? If so, hit.gameObject.name, if 'tag of DEATHZONE' then hit.gameObject.tag
(comments are locked)
|
|
I suggest a different logic. Look at the lerpz tutorial for a respawn script that uses static vars, not point to point logic.
(comments are locked)
|
|
I'm sorry I should have clarified what I was trying to do better. The game is a simple platformer where you jump from block to block to get to the end goal. If you hit the floor you are respawned at the beginning. I have been getting complaints from classmates that the game is to hard and needs a checkpoint system, so you are not sent back to the beginning of the game once you've gotten to a certain point. I've checked out and used many of the scripts from Lerpz's tutorial and still can't understand what I need to do for this issue. I was thinking that I need to cancel out the original respawn point at the beginning so the player was able to start again from the checkpoint. Once it was reached. (The Checkpoint is a basic sphere tagged as "this") DEATHZONE refers to the floor, once hit it calls for the character to be spawned at the beginning location.
(comments are locked)
|
