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"

Aim, Click, Teleport.

Hello, I was wondering if anyone knew of a way to teleport the player across a level to the position where they're aiming, and on top of this add a limiting perimeter of distance where the player can teleport. Kind of like this guy explained when he said "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)" in this post.

Thanks in advance, I look forward to people reaping the mechanic rewards from this one.

Product Version: Not Selected
Tags:
more ▼

asked Mar 16 '15 at 12:40 AM in Blueprint Scripting

avatar image

lostbxa
0 1 2 2

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

1 answer: sort voted first

I think you already have the answer within your question.

When you click the mouse button, simply do a line trace along the control view forward vector. The teleport distance limit can be easily implemented by setting the trace length to whatever is the maximum teleport distance. If the trace returns a hit, you will get the trace hit location and slope from the HitInfo. Then you can simply set the location of your character to this new location.

more ▼

answered Mar 16 '15 at 03:22 AM

avatar image

mindfane
3.4k 154 52 271

avatar image lostbxa Mar 16 '15 at 03:26 AM

Only one problem with that, I have no clue how to put that into actual code as I have no experience with UE4

avatar image mindfane Mar 16 '15 at 03:29 AM

This shows how to do a trace toawrd the centre of your screen: https://answers.unrealengine.com/questions/109310/line-trace-from-screen-center-to-world-1.html

Once you have that setting the location is extremely simple and you can figure that out yourselves. All you need is to break the hit-info whcih will give you the location of hit (ie where you want to teleport your character to)

(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