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"

Need help with 2D teleport issue

When the player overlaps the box and teleports, if something is above the player they get stuck in the wall essentially and can't move or do anything. What would be a good way of fixing this?alt text

alt text

Product Version: UE 4.9
image1.png (175.9 kB)
image2.png (98.9 kB)
more ▼

asked Dec 14 '15 at 12:56 PM in Blueprint Scripting

avatar image

161 23 25 31

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

1 answer: sort voted first

One way would be to use a line trace (raycast).

If you have line of sight to the teleportation location you can do a line trace to see where the nearest non-intersecting location could be and then use that location as the destination.

If you don't have a line of sight, you can try a line trace or a shape trace from the teleport location outward to see if what's the nearest non-intersecting point.

more ▼

answered Dec 14 '15 at 06:54 PM

avatar image

716 36 13 42

avatar image Oldsiren Dec 14 '15 at 07:17 PM

What would be a way I could connect this to the set actor location? I'm new to this in general as a heads up if this seems easy to answer, I don't want it to be frustrating.

avatar image getnamo Dec 14 '15 at 07:22 PM

A line trace usually needs a starting location, an end point and some filter specifiers. You can debug the trace by changing the Draw Debug Type.

Assuming you have line of sight, start the trace from your current actor location and either obtain a vector pointing to the place you want to go (direction * some distance you want to try traveling + start), or obtain the final guessed (the location you want to TP to).

The line trace will give you a Hit structure which you can break to get the hit location, that location + some padding should be a safe teleport location.

avatar image Oldsiren Dec 14 '15 at 07:26 PM

So I would like to have the player teleport rather than from line of sight, but how would I make the line trace begin from the end of the new location rather than the start of the new location?

(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