zondag 23 april 2017

Spawnpoints and Colliders.

For the past day I have been working on a spawnpoint system. I was inspired by games like Roblox, where you would respawn on a checkpoint you touched, I wanted to recreate this within Unity.

Here is a very early example of what would be called an obstacle course. Every blue Platform counts as a checkpoint and makes the player respawn there if they lose. (Touching Killzones)


As you can see here, the code isn't quite complicated. It simply puts the player towards the spawnpoint position if the player touches a killzone and it moves the spawnzone if the player toches a safezone.

In practice this is a very early example of toying around with losing and respawning.


Update 1: I managed to add teleporters as well, I further adjusted the frequency and appearance of the spawners whilest keeping the style simple.



As you can see I've added a lobby to spawn in, whilest also having the white squares counting as a spawn point. The blue square in the lobby teleports you to the first course, which you can see in the background.
The code I used on the teleporters, is again, very simple, and uses the tag system that Unity uses. while having a gameobject from within the scene attached to it.



Update 2:
I added another level where I made blocks that fade away when you walk on them and reappear after a given time.


This was quite a challenge to set up at itself, but I used a switch-state machine to have it work flawlessly and sequential.




This way none of the states mess with each other and it automatically loops itself back to the default position (0) if you're not standing on it.

Geen opmerkingen:

Een reactie posten