I was making a game where you’re a lantern in a cave and you need to escape before the time runs out. And I was wondering how can I make it so that whenever you press the space bar (jump) it only works if you’re touching ground?
Here’s the jump code:
function jump() {
if (gameOver) return;
var force = new THREE.Vector3(
0, 150, 0);
lantern.setLinearVelocity(force);
}
(“lantern” here is your avatar)
Thanks!
Moldy-Mango