Problems with the camera/player in a Parkour Game

Hi. I’d really appreciate some advice. I’m new to Cospaces and I’ve been grappling with building a Parkour Game using the tutorial material for several days. At times it will work, but at others the camera/player no longer appears to collide with the ground so I can’t deduct lives or end the game. I’m not sure what I’m doing to cause this to happen and it means I’m not confident to try it with students. Apologies for not being able to describe the problem well. Here’s my parkour: CoSpaces Edu :: Parkour problems. Many thanks.

1 Like

Hi @mgorman33,

The problem and solution are fairly simple, but an awful trap for coders new to CoSpaces.

The problem is that a 2nd CoBlocks collision event will override the 1st collision event, if the first parameter is the same. In your case, the player is the first parameter, so your 2nd event (reaching the target) overrides the 1st event (hitting the ground), causing it not to occur.

The solution is to switch the position of the 1st and 2nd parameters in your first event, so that in your example, player and ground are swapped.

There is another issue in your CoSpace, which is that your starting position block is on the ground, so when the Camera position is set, it also goes onto the ground, which causes the number of Lives to immediately drop to 2. The solution is to have a separate block placed high above your starting platform, where your Camera can safely re-position to. See this remixable CoSpace for fixes:

Hope this helps! Let me know if you have any further questions about this. If this solves your problem, please mark this post as the Solution.

Many thanks,
Geoff @ TechLeap

1 Like

Thanks so much. Really appreciate the support.

1 Like