Announcement

Collapse
No announcement yet.

issues with input

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

    issues with input

    Hi. I'm having problem with this simple script:

    Click image for larger version

Name:	Cattura.JPG
Views:	1
Size:	289.4 KB
ID:	1149407


    what I expected:

    When I get into the BP radius it has to enable player input
    When I leave the BP radius it has to disable player input

    When I'm in radius, so the input is enabled, and i touch the red sprite (or i click it with the mouse now that i'm on pc), the sprite has to disappear.

    What I got:
    Actually, even if the input enable/disable are triggered, the touch or click event never start. The "E pressed" event, instead, works.

    Any help?
    Second question: as you can see I use a branch and a tag to check if the player is overlapping an actor. Since it's a mobile game, if you know any better method to check this, please tell me

    Thank you
    Attached Files
    Last edited by noblex; 05-06-2015, 06:48 AM.

    #2
    Your collision is set to overlap, set it to custom and check all that applies, but make sure you check block on visibility.

    Comment


      #3
      Let's see.. I was already trying something in collision options but I didn't make it work. I'm sorry I'm really newbie in touch interface stuff

      Here is how i set the collision of the PaperSprite, which is also the root of the class BP

      Click image for larger version

Name:	Cattura.JPG
Views:	1
Size:	30.7 KB
ID:	1075817

      Comment


        #4
        Ok, I haven't been in 2d much, at all really, but I found the issue. In the Paper2d clickable events are disabled by default. In the GameMode or in the level blueprint you can set "Enable Click Events" to true on event begin play or something like that.


        Click image for larger version

Name:	Paper.PNG
Views:	1
Size:	230.4 KB
ID:	1075820

        Let me know if this works for you!

        James
        Attached Files

        Comment


          #5
          oooh, I see now. Thank you! I'll try it now!

          Comment


            #6
            Noblex,

            If you are going to be using touch events, you don't need to turn on clickable events. Just go into your project settings, Under Engine, then Input, and check the box that says "Use Mouse For Touch."

            Comment


              #7
              Yes, i'm gonna use touch event. but for debug purpouse i have to use mouse too

              Comment


                #8
                Yeah. I checked it out earlier and even with click events disabled, you can still use touch events with the mouse as long as you have the use mouse for touch events. checked.

                Comment


                  #9
                  I set the stuff as recomended, but still no touch or click event works.
                  E key still working. Mouse cursor correcly showing.

                  Click image for larger version

Name:	Cattura.JPG
Views:	1
Size:	51.9 KB
ID:	1076013

                  Here're the collision settings of the sprite

                  Click image for larger version

Name:	Cattura.JPG
Views:	1
Size:	28.4 KB
ID:	1076014

                  Comment


                    #10
                    So, you need to find the cause. I think it may be your overlap event. Allow the player to tap on it whenever and see if it works. If it does then add the overlap. However, I would not do it the way you have it. On overlap, I would set a bool variable that in the actor. then when I click, if the bool is true it removes it. If not, nothing happens. So on overlap with player, not with tag, I don't like that. If overlap actor == player set it to true then when he leave, set to false. look at the image below. that is all it takes.

                    Click image for larger version

Name:	input.PNG
Views:	1
Size:	326.9 KB
ID:	1076015

                    I have click events disabled, but I have set use mouse for touch events enabled in the inputs and it works for me in the 2D map. No issues.

                    Comment

                    Working...
                    X