I’am creating a game where player can change the game object using mouse wheel and he/she have to pass through the incoming obstacle without colliding by using keys WASD
The problem I’m facing here is collision between obstacle and player is not properly detected when obstacle is moving as shown in below videos.
Playground link: Playground
- Collision between player and object is properly detected when player collides with obstacle at the edges as shown in video-1
- Collision between player and object is not detected when player is colliding with obstacle completely as shown in video-2
- Collision is working as expected in both cases(colliding with edges and colliding completely with the obstacle) when I stop moving obstacle by commenting line number 110
obstacle.position.z += 0.05;and start moving my player towards the obstacle as shown in video-3
What may be the reason for this behaviour and how to solve this?
NOTE: Click on game screen once to move game object
It would be really helpful if someone helps me in solving this…