Announcement

Collapse
No announcement yet.

Hit testing ("picking") mesh instances

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

    Hit testing ("picking") mesh instances

    I know this must be possible, but I can't figure out the proper way to achieve it.
    In a 3rd person project, I'm trying to project a raycast/trace from the camera, through the player, onto a mesh instance, and return the index of the mesh instance that was hit, if any.
    Here's a video demonstrating one of my many attempts at accomplishing this...
    (You might need to watch it on youtube in fullscreen to get a clear image)



    As you can see, I have the hit testing part working just fine, and I feel I am very close to success.
    And I realize the code isn't perfect, but I've tried various methods and can't seem to solve the problem of getting which instance was hit.
    Does anyone have any idea how to achieve this?
    Last edited by MichaelWion; 08-06-2015, 07:51 PM.

    #2
    The 'Hit Item' return pin on the hit result is the index of the hit instance.
    Marketplace Assets

    Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
    Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
    Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

    Comment


      #3
      Holy hell... I tried that previously, and for whatever reason, it always returned 0...
      But I did it again just now and it worked! Thanks!

      Comment

      Working...
      X