Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 samerek99 · Aug 11, 2016 at 01:11 PM · portals

seamless portals like in the game portal

The script that I have teleports the player from one object to another with collisions but I'm looking for it to be more like a gateway sort of like in portal where you could have one foot in one and the other foot out the other. Any help or code for this would be greatly appreciated.

using UnityEngine; using System.Collections;

 public class Portals : MonoBehaviour
 {
     public GameObject otherPortal;
 
     void OnTriggerEnter (Collider other)
     {        
         if(other.tag == "Player")
         {
             other.transform.position = otherPortal.transform.position + otherPortal.transform.forward * 2;
         }
     }
 }  
Comment
Add comment · Show 1
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 RobAnthem · Apr 07, 2019 at 11:01 PM 0
Share

I've though about his in the past and my solution would be the following. You would need:

  1. 2 copies of the character, one for the portal entering, and one for the portal co$$anonymous$$g from.

  2. A dissolver plane that dissolves based on an objects intersection.

  3. A render texture for the main texture of the portal, allowing you to see through it and see the other character.

  4. Sync the animators of both characters and position them equally in and out of each portal as the main player moves in and out of it. Use the initial trigger of the player colliding with the portal to enable and disable the secondary player. When the player fully passes through the portal you can initiate the transportation effect and disable the other characrer, OR if you do it properly you can use both character interchangebly, and switch back and forth as needed.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by lunoland · Aug 11, 2016 at 06:10 PM

An effect like this is actually quite difficult and at a minimum might require that you clone and mask part of the character object. It's not the kind of thing you'd be able to ask on here and get a response where someone codes it for you.

If you wanted a portal to show the area on the other side you would need to work with custom shaders, and it gets even trickier in a first person situation moving the camera through the portal. All this stuff is non-trivial and requires lots of knowledge (especially the shader stuff, which can get pretty esoteric).

It sounds like you're just starting so I would recommend making your portal mechanic work within the confines of what you know how to do. It seems like you're on the right track there; If you add an animation for entering a portal that you play when the player collides with a portal, and an animation for stepping out of the portal that you play at the player's new position, it could be very convincing.

If your game absolutely requires a seamless effect, there may be some asset store solutions that might give you what you want, or you can just dive in trying to figure out how to do it yourself on Google. I found a bunch of info in minutes of searching, including this thread: http://answers.unity3d.com/questions/123547/seamless-portals-into-other-spaces.html

Realistically though, I think this will be overwhelming. You're more likely to finish the game and continue learning if you change the scope to be more inline with your current abilities.

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

6 People are following this question.

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

Related Questions

Portal between scenes? 3 Answers

Creating portal camera view with render textur 0 Answers

Are overlapping Occlusion Portals (one open, one closed) treated as an opening, or a blockage? 0 Answers

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

3D portal effect on plane 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