- Home /
How to perform a wrap-around?
I'm working on a platformer that has static levels (i.e. non-scrolling). Some levels will have platforms that are open at the edge of the screen. At the moment I have a system that uses triggers to determine when a gameobject is leaving the edge of the screen.
The problem is that it doesn't look right. When an object hits the first trigger, it disappears and reappears at the position of the 'partner' trigger at the other side of the screen. What I would like instead is that an object moves off the edge of the screen but wraps around and appears on the other side of the screen smoothly (i.e. walks on rather than just appear).
I'm trying to figure out the best way of doing this. This game is likely to be desktop/console only. There will be a variant for mobile platforms. So I don't think there's as much of a need for resolution independence.
Can someone suggest a way of doing what I need? I'm struggling to get my head around it.
When you are wrapping around the screen, you will have a point where the part of the character is on the left side and part of it is on the right side. You would essentially need to have two characters then, which can get a bit complicated to deal with.
Depending on your needs, it might be easier to cover this up using special effects. Here is an example that I think is pretty good (the example starts at around 20 seconds in): https://www.youtube.com/watch?v=-65rvOO0uqY
Notice how the pieces of tree/mist obscure the edges of the screen where you might see the character wrap. This eli$$anonymous$$ates the need to have any complicated mechanism that handles having the character in two locations at once.
Thanks. That's a good idea. The only problem is that I'll have to completely rework the graphics to fit it in, although that may not be so bad - although it'll push the project back by 2-3 weeks. The link you provided has given me an idea (that's a great looking game).
Your answer
![](https://koobas.hobune.stream/wayback/20220612001515im_/https://answers.unity.com/themes/thub/images/avi.jpg)