Announcement

Collapse
No announcement yet.

Problem Getting Touch Location

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

    Problem Getting Touch Location

    The problem that I ran into is trying to detect when the player touches the screen if its over an actor of a certain type example npc or enemies and target said actor. I have a general idea of what to do, but I am stumped on what nodes to use. I know that I need to get the touch location of the screen then run a line cast or some form of collision test to see if it collides with an actor. Any help would be appreciated.

    #2
    You don't even need to do a line trace. Just use a Get Hit Result Under Finger by Channel node. Then you can compare the hit actor with the types of actors you want to look out for (In your example it would be npc or enemies).
    Logitech Wheel Plugin

    Comment


      #3
      I tried using that node but for some reason it wont show up in the character blueprint it only shows up in controller blueprints. When i get off today ill look at it some more thanks for your help.

      Comment


        #4
        If you want to call that node in your character, then you need to get that character's controller first.
        Logitech Wheel Plugin

        Comment


          #5
          So we have a german trying to sell male enhancements unless google translate is extremely off.

          Ah ok thanks.
          Last edited by eXi; 08-24-2015, 06:14 AM. Reason: Doublepost

          Comment


            #6
            Originally posted by BIrvin View Post
            So we have a german trying to sell male enhancements unless google translate is extremely off.
            Sorted. Not sure how that individual got past the moderation queue. 8-{
            Quinton Delpeche
            Founder - Gobbo Games | Designer - The Colony 2174 (Board Game) | Developer - Riders of Asgard

            Comment


              #7
              Yea i know thats why i mentioned it.

              Comment


                #8
                Originally posted by BIrvin View Post
                Yea i know thats why i mentioned it.
                Thanks for that. Next time just use the "Report Post" option and all the moderators will get notified and deal with it. 8-}
                Quinton Delpeche
                Founder - Gobbo Games | Designer - The Colony 2174 (Board Game) | Developer - Riders of Asgard

                Comment


                  #9
                  Click image for larger version

Name:	BP.jpg
Views:	1
Size:	94.4 KB
ID:	1084144
                  Hopefully my screen shot showed up like it should, but that is what I have so far and its not doing a darn thing. Figured I would upload it to see if I am missing anything. NumHits is just an int that should +1 every time I tap on an actor type of testbaddy. Just trying to get that simple bit before I move onto finishing the targeting system.

                  Comment


                    #10
                    Am I just missing something or is everyone just as stumped as i am?

                    Comment


                      #11
                      If you just get the actual actor output and do a print string from it what does it show?

                      Comment


                        #12
                        Does your "Input Touch" get called? Where are you testing this, in the Editor? Have you enabled simulating
                        Touch events with MouseClicks in the ProjectSettings->Inputs?

                        I'm using these exact nodes and it is working on my end. You also may want to disconnect the "Released" event
                        or the "Pressed". At least one of them. Because otherwise you do 2 klicks per touch.
                        Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

                        My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
                        (Including 100+ Pages Multiplayer Network Compendium to get you started.)

                        Comment


                          #13
                          Let me look in the settings, and yes I am testing this in the editor. As for the string no that's what my num of hits integer is for.

                          eXi did you place the nodes in the controller or character blue print?
                          Last edited by eXi; 08-24-2015, 11:37 AM. Reason: Doublepost

                          Comment


                            #14
                            In my Controller.
                            Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

                            My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
                            (Including 100+ Pages Multiplayer Network Compendium to get you started.)

                            Comment


                              #15
                              I moved the nodes into the player controller itself and is now breaking at the break points not sure why touch event wasnt even firing. So updated problem when i clicked on my test baddy it just passes through and hits the floor.

                              Comment

                              Working...
                              X