Announcement

Collapse
No announcement yet.

Crosshair offset from center - how to get accurate trace to crosshair exactly

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

    Crosshair offset from center - how to get accurate trace to crosshair exactly

    I have been experimenting with offseting crosshair from center of the screen, to another position.

    Here is blueprints:



    And here is the issue:





    Does anyone have any idea how to get correct value for end trace, so it will match crosshair exactly ? Or maybe someone have another idea how to approach it. What I need essentialy is crosshair offseted from center of the screen, and then trace which will hit exactly at crosshair location.
    https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

    #2
    You should use the the 'World Position' pin-out from the Deproject node as the starting point of the line trace, and the ending should be World Position from Deproject plus its direction times some value.

    Start = Deproject's World Position
    End = (Deproject's World Position) + (Deproject's World Direction * 100000)

    Comment


      #3
      First of you should put the default crosshair to -8,-8 since its 16x16 and the default hud renders its to the middle of the screen

      afterwards you should start your trace at your cameras position

      should be in the middle then
      Free Inventory System (BP AND C++ Version): Clicky Clicky
      Player Structure System (Houses!) (BP): Pew Pew Marketplace Version: Yoink!
      Howto: Create Dragable UMG Windows: Zoom Zoom

      Comment


        #4
        Originally posted by cancel View Post
        You should use the the 'World Position' pin-out from the Deproject node as the starting point of the line trace, and the ending should be World Position from Deproject plus its direction times some value.

        Start = Deproject's World Position
        End = (Deproject's World Position) + (Deproject's World Direction * 100000)
        Thanks. That solved the issue.
        https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

        Comment


          #5
          Originally posted by cancel View Post
          You should use the the 'World Position' pin-out from the Deproject node as the starting point of the line trace, and the ending should be World Position from Deproject plus its direction times some value.

          Start = Deproject's World Position
          End = (Deproject's World Position) + (Deproject's World Direction * 100000)

          I have the same issue, and I can't see the images, so I don't really know how do adapt this to my blueprints

          Could you specify, please?

          Comment

          Working...
          X