Game Development with Unity for Web Developers Falling Sphere Exercise
Transcript from the "Falling Sphere Exercise" Lesson
>> So next I have an exercise here, and we need a way for both the player and the opponent to get back to their original position if they get knocked off the board, right, so we wanna do this inside of RollingMovement and we want to add a Y-height check.
[00:00:25] So if the Y position of either of the spheres is below the respawn height that we created in the GameManager, we should reset the position of the sphere. So if the spheres fall off the side of the board, we should reset the position and remember again, in the GameManager we created a globally accessible static variable to hold what the respawn height should be, you should use that to reset the position here.
[00:00:58] And again, this is a snippet of code, but inside a fixed update you want to do this on the RollingMovement component.