Snake portal

How can i make a portal where i hit the wall and come through the opposite side. still showing the tail end of my mesh in front of me as in the snake game. im a beginner at unreal but trying to create a 3d snake type game. if some one could help me with this would be grateful.

Well, have you seen the movie Prestige? It’s the same. One snake disappears, while another appears from somewhere else. You make a copy of it, and possess it with another player controller, and the show goes on. And no one cares about the snake that disappeares. :frowning:

This is what I would do:

Make an array of size N. N is the number of segments that you want to support. Then you spawn a segment for every non-null entry in the array. Every move you move only the head, then shift the entire array down once and update the head position.

For example:
[<1, 1>, <1, 2>, <1, 3>, <1, 4>]
The head is at <1, 1> and is moving upwards.

After turning right once we get:
[<2, 1>, <1, 1>, <1, 2>, <1, 3>]

Then just update the position of each mesh to match. You can do this by storing each instance of the static mesh in an array that match the order of the position array.

Doing this you can teleport through walls by only moving the head. The body will follow automatically. If you are about to pass through one of the walls, just spawn the head on the other side and let the snake update itself.

HTH

Thanks for both getting back il try both of these today and see what i can do. normally follow a lot of videos on youtube as just learning blueprints at the moment. If you could show me a screen shot of how u set that up NoobsDeSroobs that would be great :smiley:

Good luck. I have had a hard day, but I can make you some quick hints tomorrow. Good night.

http://puu.sh/srGC3/7004c09a4b.png

Something like this would work.

http://puu.sh/srGEG/521ea90e0b.png

And then you do this to update the mesh locations.

Thanks man appreciate it :smiley: will give this a go im not to great at the blueprints but will give this a stab

I noticed a problem after I scrapped the project I made to show you, but the loop needs to go from the end towards the top, not the top towards the end. You overwrite 4 with 3, then 3 with 2 etc.

yeah im a little stuck with it i think its a bit advance for me :s but thank you