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"

Teleport player without him noticing

Good day to you all.

I am trying to teleport a player in what seems like quite an unusual way. I want to teleport my player to one corridor to another, the two corridors being an exact replica of each other, but placed in different coordinates of my level.

What I'm trying to do, is teleport the player but I wan't him to be unaware of the teleport. Hence, going through the corridor (which has a trigger to teleport in the middle) should be no different than walking through a normal one.

This is the very reason why both corridors are exact replicas, so the player can't tell the different when they are teleported.

I have tried to use both teleport and set actor location, and in both cases, i've tried storing the force, applying it afterwards... nothing. I can't manage to accomplish a flawless teleport. When the player is teleported, the camera always does like a jitter small thing that makes it pretty obvious something has happened (although the camera and player positions are working correctly).

Is there a way to achiveve this? I kinda want to do something similar to what the game "Antichamber" does, in that game you get teleported several times to different rooms but you never notice.

Here are some screenshots of the level from the top view: Teleport corridor 1 (notice the trigger green line in the middle) alt text

Teleport corridor 2 alt text

Full level alt text

Product Version: UE 4.19
Tags:
captura-1.png (8.8 kB)
captura2.png (9.0 kB)
captura3.png (70.4 kB)
more ▼

asked Jun 20 '18 at 04:48 PM in Blueprint Scripting

avatar image

manumeq
1 1 2

avatar image Tuerer Dec 16 '18 at 07:49 AM

I believe you have already considered doing that the other way around and teleporting locations instead of the character?

Here's another thought: what if you create two same locations one above the other, and when a character walks along the corridor, you just move the corridor itself up and down; if a corridor is long enough it will move quite slowly so the player won't notice anything.

I don't really know how those things were implemented in Antichamber and The Stanley Parable, for instance, just something that came to my mind.

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

2 answers: sort voted first

When you teleport the character do you take the offset of the player to the center of the trigger volume into account? The player likely never enters the volume in the exact same place so when you teleport him to a mirrored location without that offset a change would be noticeable.

So basically just subtract the players location from the collision volumes location(or the mirror point of your teleport location) save this vector in a variable called Offset. Then when you make your teleport transform subtract the Offset from the location you are going to teleport them to. EDIT: Also if you're teleporting to a mirrored location where you rotate the player π you would ADD the offset opposed to subtract it.

alt text

I'm sorry if this is something you already thought of, it just seems like it would be a common oversight in my opinion.

Cheers

6.png (21.0 kB)
more ▼

answered Jun 20 '18 at 06:18 PM

avatar image

enearle
210 4 4 6

avatar image manumeq Jun 20 '18 at 06:57 PM

Thank you enearle. Yes it is a common oversight, and yes, it is something I already thought of too (in fact one of the very first things I fixed).

However I did not solve the problem like you showed above. What I do is substract the world location vectors of both triggers to obtain the distance between them for each coordinate. Once I have that distance, I add it to the player's own world location and that final vector is what I add to the teleport node.

I don't know is this method differs in result with what you show me. I highly doubt it since my position after teleport is consistent (if I enter trigger from the left, I appear from the left at the other side). Just in case I'll post my blueprint code here:

alt text

captura4.png (294.8 kB)
avatar image enearle Jun 20 '18 at 07:38 PM

No, your method should work fine.

avatar image FranekPL Dec 17 '18 at 02:50 PM

hi I did something similar and it works just fine until I walk too close to trigger edge alt text

asd.png (114.1 kB)
(comments are locked)
10|2000 characters needed characters left

Hmmm, the only idea that comes to mind is to swap characters. While both are controlled at the same time with the same input. Here is some info on this:

https://answers.unrealengine.com/questions/87715/control-2-pawns-with-1-controller.html#answer-87948

Hope it helps

more ▼

answered Jun 20 '18 at 05:11 PM

avatar image

Felix Leonhart
476 3 4 7

(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