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"

How would you teleport to a point in front of you?

Hi, I am having trouble figuring out how to teleport my character to a point, say 50 units in front of me. How would I go about doing this? I looked at this forum, and it shows you how to teleport in a single axis (https://answers.unrealengine.com/questions/132628/teleportation-in-a-single-direction.html)

Also I was thinking it would be really cool if you could teleport to a location, again lets say 50 units, in front of the camera, so that I would be able to teleport in any direction based on where I was looking.

Thanks in advance.

Product Version: Not Selected
Tags:
more ▼

asked Feb 10 '15 at 06:26 AM in Blueprint Scripting

avatar image

fyunae13
1 2 5 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi, something like this should do the trick (T teleports according to the camera direction, R teleports in front of the character)

alt text

NB: i multiplied by {50,50,0} to remove the Z component and prevent teleporting through the ground, it's not a 50unit teleport, i should have removed the Z component then normalized the vector then multiplied by 50 but it would have been harder to read.

more ▼

answered Feb 10 '15 at 08:15 AM

avatar image


1.5k 47 32 103

avatar image fyunae13 Mar 03 '15 at 05:06 PM

Thank you so much, I was wondering how to do something like that. There was a problem with teleporting through the landscapes like the mountains. Is there a way to stop that from happening or may if you are near the mountain you just teleport to the other side. Also I was wondering, how would you teleport into the air like onto a ledge or something like that?

avatar image Mar 03 '15 at 05:14 PM

Instead of just teleporting the actor you can compute the new location as explained in my 1st comment then make vertical a line trace check upon this location to find the "ground" there and your teleport will follow the relief of your landscape (not sure if this is what you need but it seems to be a good idea)

avatar image fyunae13 Mar 17 '15 at 04:28 PM

I am a complete beginner and I have no idea what I am doing. So what do you mean by vertical line trace and normalizing a vector. Also how do you take out the Z component. Like I said, I am a complete noob.

avatar image Mar 17 '15 at 05:40 PM

Here is one way to do what i explained in my last comment, it makes a vertical line trace 50cm in front of the character (to find the ground), and then teleport the actor on the ground at this location.

TeleportWithLineTrace

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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