Add a Black Hole in a 3D snake game

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;
}

Unfortunately, your question is way too broad. In almost all cases, questions like that never get the desired comprehensive answer that explains all what you need step by step.

I suggest you edit your question and focus on a single specific topic.

1 Like

Sorry about that, I’m a beginner so excuse if I made any mistake. Can you suggest anything after the edit that I have made? I appreciate any help.