Without seeing your code, I can only guess. If you could share the code, I would be happy to help!
Either use the share option from the menu in 3DE or copy and paste it directly into your reply. The share option is less error prone. If you prefer copy & paste, be sure to paste it between 3 backtick lines:
Explain how your code is misbehaving...
```
// Paste your code here
```
Include any more information that you like here...
Based on the error messages alone, it sounds like you’re missing the following line inside the checkForTreasure()
function:
var p2 = marker.position;
And maybe have not defined the jump()
function yet, which should be above checkForTreasure()
as:
function jump() {
if (avatar.position.y > 0) return;
checkForTreasure();
animateJump();
}