Announcement

Collapse
No announcement yet.

Teleport upto 10 meters ahead?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Teleport upto 10 meters ahead?

    Hi, I am looking to recreate a teleporting system from Dishonored.
    I want to be able to teleport upto 10 metres, choose teleport location in this radius and not be able to teleport trhough obstacles like walls. Please help!

    #2
    One of the first results from Googling "ue4 teleport player".
    Logitech Wheel Plugin

    Comment


      #3
      Originally posted by drb1992 View Post
      One of the first results from Googling "ue4 teleport player".
      As you may guess the first or the second result may not be always relevant to the question. I have seen this thread before and it's has nothing to do with my question as
      I cant choose teleport distance and I go through objects when I teleport with this method

      Comment


        #4
        Originally posted by QurbanOlum View Post

        As you may guess the first or the second result may not be always relevant to the question. I have seen this thread before and it's has nothing to do with my question as
        I cant choose teleport distance and I go through objects when I teleport with this method
        Hey QurbanOlum,

        This is fairly easy - here are the high level steps:
        • Do a Line Trace by Channel and shoot it forward up to 10 meters (use the same setup as in that thread with your forward vector).
        • Then break the Hit Result and check if you hit something. If you did NOT, then teleport by using the method in that thread.
        • If you hit something, grab the Hit Location and subtract it from the Actor Location. Then get the Vector Length and multiply this by 0.9.
        • Then use this new Float value and multiply it by your Actor Forward Vector and grab this vector and teleport to this location.
        Basically, if you hit something with the line trace, you want to get the distance between the Player and the hit location and reduce the distance by some percentage (in this case I got 90% of the distance). Then multiply this distance to your Forward Vector to get the new vector location. Use this location and teleport there.

        Hope this helps!
        [WIP] Procedural City Generator | RPG AI
        [MARKETPLACE] Animal Behavior Kit | Space Shooter Template | Procedural Foliage Tool | Procedural Park
        [FREE] Modular Road Tool | Action Platformer Template | Radar BP | Free Birds | Procedural Buildings
        Join our Discord

        Comment


          #5
          Originally posted by CoquiGames View Post

          Hey QurbanOlum,

          This is fairly easy - here are the high level steps:
          • Do a Line Trace by Channel and shoot it forward up to 10 meters (use the same setup as in that thread with your forward vector).
          • Then break the Hit Result and check if you hit something. If you did NOT, then teleport by using the method in that thread.
          • If you hit something, grab the Hit Location and subtract it from the Actor Location. Then get the Vector Length and multiply this by 0.9.
          • Then use this new Float value and multiply it by your Actor Forward Vector and grab this vector and teleport to this location.
          Basically, if you hit something with the line trace, you want to get the distance between the Player and the hit location and reduce the distance by some percentage (in this case I got 90% of the distance). Then multiply this distance to your Forward Vector to get the new vector location. Use this location and teleport there.

          Hope this helps!
          Thanks man, will try it

          Comment

          Working...
          X