Richard Morgan

Here’s a quick way to respawn in Unity using delegates and events…

In this example, we’re going to use the SpaceBar to initiate the respawn event:

Inside our Main script (attached to the MainCamera), we’ll create the Teleport delegate and give it a Vector 3 value that will be the destination. And also create an event that is tied to the delegate, and make a variable to hold our destination as a Vector 3 value:

--

--

Here’s an easy way to switch cameras using triggers in Unity. Here’s the result:

We’ll use a GameObject called Managers to hold the CameraManager script that makes our array values available, and it will also hold our public functions that will update the priorities on the cameras as the triggers are fired:

--

--

Richard Morgan

Richard Morgan

Unity and Flutter developer interested in creating mixed-reality applications.