I am making a 3D snake game and I’d like to have 2 two black holes at (0.25,0.25,0.25) and (0.75,0.75,0.75), if the snake enters at one black hole, it should come out in the next black hole, in the same axis it is moving.
I have already tried the following code:
if(head.mesh.position == blackHole1Pos){
head.mesh.position = blackHole2Pos;
}
else if(head.mesh.position == blackHole1Pos){
head.mesh.position = blackHole2Pos;
}