Tip:
Highlight text to annotate it
X
okay
let's go for a little bit target practice
off on this gigantic terrain
and...shooting boxes is fun
all right let's just go for a walk over here
what's this
the edge of the universe
look at us falling down down down
forever and we'll just keep falling
and we can't do a thing but quit the game
that's a problem
the solution
is a very very simple script
uh, which I've called "respawn"
and that's script
really only does two things
one, it checks
if the worm
has a position on the Y axis of less than a hundred
and you pretty much know if it's less than zero
then you have fallen off of the grid
because
the entire terrain
is above
zero
on the Y axis
and if it is below one hundred
it moves the worm
position back to you to the respawn point
the re-spawn point is being passed in by this vaiable
%uh, from an empty game object
that I've located somewhere
on the terrain
so now if we turn on that script
and run this again
%um
we can shoot our fire balls
and now when we run over here
and fall off the edge of the universe
as we're watching
the worms y-position hits one hundred
negative one hundred
we're right back where we started
and can continue game plan