Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by KOKOStern · Jan 13, 2014 at 08:16 PM · rendering2d-platformerteleportportals

How do I render 2D Sprites partially (side to side teleport)

I'm new to Unity as well as game engines and am still learning how to deal with cameras, rendering and the like.

My first project is an attempt to execute a lot of basic mechanical tropes in 2D platformers. I am using Unity in it's 2D layout with 2D assets.

Currently, I'm trying to have the edges of the screen be connected, meaning if you jump off the right side of the screen, you will show up on the left side and vice-verse.

This is very easy to do in the basic position (transform) sense, but I'm unsure how to approach actual rendering.

I'd like to have the sprite show up partially at each side of the screen if she is currently in between. I want to have 0 space between the left and right side of the screen. When you walk off the right side, the sprite starts appearing on the left side of the screen immediately.

Code samples are highly appreciated!

Thank you.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image robertbu · Jan 13, 2014 at 08:40 PM 0
Share

The only way I can thing to do this in Unity Free is a bit of slight of hand with an extra copy of the object...might get tricky if you want the extra copy to be impacted by things like collisions.

avatar image KOKOStern · Jan 13, 2014 at 11:53 PM 0
Share

That was the way I thought to do it, but I was wondering if there's a better option. Doesn't seem to be without pro. =\

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by legion_44 · Jan 13, 2014 at 08:35 PM

If you use pro version. You could do this using RenderTexture.

http://docs.unity3d.com/Documentation/ScriptReference/RenderTexture.html

If you have pro version comment and I will write something like tutorial how to do this.

Hope that helps you somehow,

Paul

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image KOKOStern · Jan 13, 2014 at 11:55 PM 0
Share

As I mentioned I'm new to Unity and currently a student so I don't have pro and don't intend to get it any time soon.

Any other options you see possible except for creating a copy?

Edit: I have a friend with Unity Pro and I'd love to at least test it out there. Could you elaborate a little bit about the Render Texture solution?

Any example code will be highly appreciated!

avatar image
0

Answer by KOKOStern · Jan 15, 2014 at 08:21 PM

I ended up creating a clone on the opposing side of the screen and then teleporting to it and destroying it when my original gets completely out of the screen.

The clone is an imperfect one, which means it's a different prefab. The only difference is in the "side to side teleport" script. The original can create clones once he reaches the proper point, and if he goes beyond the screen, he teleport to the location of the clone, and destroys it. The clone can not create other clones himself, but does destroy himself if he ever goes off screen (which means the original decided not to go all the way out of the screen).

This explanation is kind of hard to follow. I made a video that shows it in action if that helps. (The video does not contain code).

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by jason_barnes · Apr 02, 2014 at 07:17 PM

This might be helpful even though the solution is more of a hack.

http://gamedevelopment.tutsplus.com/articles/create-an-asteroids-like-screen-wrapping-effect-with-unity--gamedev-15055

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Sprite leaves a tail behind it in PlayMode 0 Answers

Portal between scenes? 3 Answers

"Warping/Teleporting Out" Objects in space 2 Answers

making a non walk through portal 2 Answers

URP 2D renderer not working 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges