Return to location


#1

My students are obsessed with making parkour games. The built in navigation makes it easy to run. The kids build the platform and then they can jump from one to another with the arrow keys. However- they want this to happen… when a player falls from or misses any platform they want the use to return to the starting point of their parkour course. How would they code this with the coblocks? Is it the camera that gets coded?


#3

Hi @Mary_Beth_Burns!

To reset the position of a camera when it falls down you can do the following:

  1. Create a ‘resetZone’ - cube which defines where the reset should happen
  2. Add the camera item and the resetZone cube to CoBlocks

Then, in CoBlocks:

  1. Save the starting position of the camera to a variable
  2. Use a “when collision” - block to check when the camera collides with the resetZone cube
  3. When the collision happens, place the camera back to the starting position

Below you can find an example space you can remix to see how it’s done in CoBlocks :slight_smile:

Hope this helped!


Touching the ground (stage)
#4

Thank you so much!! You’ve made a lot of 5th graders very happy!


#6

Are any of your Parkour games in the gallery? I’d love to see what you/they have come up with. Sounds fun!! Are you using physics?


#7

They aren’t in the gallery yet. Their log in accounts are attached to their school gmail account and it has their full name. I can’t post it with their name attached.


#8

I wonder if you were to copy their work to your spaces if it would delete their name or allow you to do so?


#9

They can also change their username for extra anonymity as shown here.


#10

I forgot about this. Thank you!


#11

I shared it but then had to take it down. The kids had written their full names on a wall in their course. Ha ha! They’re going to edit it and I share it again. They are very excited to share with the world!


#12

I’m not able to get the camera to collide with different objects. For example, I have the camera return to location using the method you described (When Collide), but I cannot add another When Collide for the camera to collide with different object (to go to another location, for instance). When I try, the first When Collide stops working.


#13

Please take a look at another thread to see how event handlers work in CoSpaces. The most important there is that only one collision handler of a particular type can be active at the same time on a given item. You can find a workaround for this in the thread linked above as well (one of them is using single “when collide” block with “if-else” statement inside).