x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Camera overlaps and teleportation

Hi, I am trying to replicate the portal effect from VALVE's game "Portal" (I am sure you've heard of it and understand what I am talking about). I have gotten the portal rendering down but now I am trying to script the portal teleportation and I have one big issue.

I cannot simply teleport the player to the portal location once the player overlaps because it ruins the smoke and mirrors effect (portal teleportation doesn't look seamless) so I have to come up with a different method... and I have. Each portal has a camera attached to it (that moves relative to the player) and I basically want to move the player camera to the portal cameras position once the player camera overlaps the portal plane.

How do I make the portal plane ignore the player collision capsule component (I am using the FPS template) and only overlap once it collides with the player camera component? And also, how do I teleport the player camera to the portal camera position ALONG with the rest of the player (the player camera is a child component so if I teleport that specific component I assume that the rest of the components wont follow?)

Note: I also want the portal plane to overlap with ALL other objects in the scene... just not the player capsule component itself.

Product Version: UE 4.15
Tags:
more ▼

asked May 16 '17 at 05:00 PM in Blueprint Scripting

avatar image

Schytheron
56 3 6

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

You want much ))

Well, I tried to make some portals to grow my knowledge, and here is my tutorial about.

https://forums.unrealengine.com/showthread.php?143808-Tutorial-Simple-Portals

For now I'm working on update for this tutorial and example project, which includes seamless teleportation. But you can't make it really seamless because of rendering.

Valve renders portal view with stencil buffer and directly to screen.

Scene Capture renders portal view to texture that simply mapped to some portal plane. As you maybe know, player camera have near clip plane distance = 10 units, and when it closer than 10 units to anything, it will clip it.

So, to avoid portal's surface clipping, you must teleport camera at least at 15 units from 1st portal to 15 units from 2nd portal. This is a little bit noticeable anyway.

Btw, I'm using PlayerCameraManager for camera calculations with "BlueprintOverrideCamera" function, and without camera component in player character. This allows me to avoid problems with camera relative location/rotation to player character and set world camera transform directly.

Well, if you wait few days for my update for tutorial, you will get example project with already implemented "seamless" teleportation.

more ▼

answered May 17 '17 at 10:19 AM

avatar image

redbox
4.2k 79 16 102

avatar image Schytheron May 17 '17 at 11:17 AM

Thanks for the tutorial! Seamless teleportation however seems to be possible in UE4. I have seen several people on Youtube who have achieved this. This guy for example: https://www.youtube.com/watch?v=j7rYvPtuEFg . He managed to write some sort of clip fix in BP (I don't know how though).

But most impressive is this guy:https://www.youtube.com/watch?v=5vayBKZl77I . He managed to create (almost) perfectly seamless Portals in just 7 minutes. Too bad I can't exactly tell what he does in the very end since he doesn't explain why he does the things he does.

By the way I also found this interesting video (definitely worth a watch): https://www.youtube.com/watch?v=_SmPR5mvH7w . In this video the guy explains exactly how the portals in "Portal" work and how he managed to replicate them in Unity.

avatar image redbox May 17 '17 at 11:48 AM

This guy for example: https://www.youtube.com/watch?v=j7rYvPtuEFg . He managed to write some sort of clip fix in BP (I don't know how though).

Well, maybe this is done with post process material and custom depth, but it hard to implement, specially for more than 2 portals in scene

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question