I am making my first game with babylon and visual studio code. I am using mutiple scripts (they are commented on the playground).
on the initializing of the game you see 4 “hole” objects (initHoles(player, scene). You move the player clicking on the ground. if the player collides with a hole you get a console.log DEAD. It is working!
the problem starts here: After one second each hole gets replaced with a new one (setTimeout(holesTimer(player, scene), 1000) I register the collisions for those new ones with the same function .The replacement of the meshes works but the player is not colliding with the new holes. any idea why?
every thing relevant should be on the “HOLE CLASS” (the pg is big):
Thank you very much!