Announcement

Collapse
No announcement yet.

Swipe event

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

    Swipe event

    Hey everybody,
    I have been trying to get mobile input events using unrealscript, i have managed a simple touch using the MobileMenuScene but I dont see how i can catch a swipe event. Anybody have an idea how to do this?

    Greetings,
    Xander

    #2
    Same question D:

    Is it only possible to register the swiping with KISMET or is it possible by code?

    Comment


      #3
      Swipes can be registered with a trackball input zone. These can be hooked up to keybinds that drive properties. This is how the non-joystick controlled looking in EpicCitadel is done.

      Or, you can use the OnInputTouch delegate in MobilePlayerInput to handle the input anyway you want.

      Code:
      delegate OnInputTouch(int Handle, EZoneTouchEvent Type, Vector2D TouchLocation, float DeviceTimestamp);
      With that, you need to write your own logic for registering the input events, but it is certainly possible to detect swipes with the information provided.

      Comment


        #4
        Ok, I have found that delegate. Maybe a noob question but how to I use that delegate, if tried the following but that doesnt work:

        Code:
        event OnInputTouch(int Handle, EzoneTouchEvent Type, Vector2D TouchLocation, float DeviceTimestamp){
        	`log("Touched: X: " $ TouchLocation.X $ ", Y: " $ TouchLocation.Y $ "EventType: " $ Type $ ", TimeStamp: " $ DeviceTimestamp);
        }

        Comment


          #5
          Lots of info on how to use delegates:

          http://udn.epicgames.com/Three/Unrea...Delegates.html
          http://udn.epicgames.com/Three/Maste...Delegates.html

          Comment


            #6
            ok i read those but i still dont totaly get it. So delegate OnInputTouch in not like an event that gets called when you touch your ipad. I have a class extending MobilePlayerInput and i want a function to be executed when somebody touches the screen so i can get the touch location. If i look at the delegates examples you just gave me it appears to me that is a like a function not an event.

            Comment


              #7
              I think you want to do

              Code:
              function InputTouch(int Handle, EzoneTouchEvent Type, Vector2D TouchLocation, float DeviceTimestamp)
              {
              	`log("Touched: X: " $ TouchLocation.X $ ", Y: " $ TouchLocation.Y $ "EventType: " $ Type $ ", TimeStamp: " $ DeviceTimestamp)
              }
              
              event Initialized()
              {
                  OnInputTouch = InputTouch;
              }

              Comment


                #8
                Yes that is what i would want, but its not working yet, this should also work with the mouse clicks while testing on a pc right?

                Comment


                  #9
                  Yes, the mouse should register as touch input, at least when you run the Mobile Previewer.

                  Comment


                    #10
                    Mobile Swipe Kismet

                    Does anyone know how to set this up? In Kismet -new even - Mobile Simple Swipe? Even a simple screen capture of the set up would be great!

                    Thanks

                    Comment


                      #11
                      How to set what up exactly? There is an example of using that event to do simple player movement here:

                      http://udn.epicgames.com/Three/Mobil...h Input Events

                      Comment


                        #12
                        I setup a top down game similar to jazz example (controls and camera) and added the swipe to get my pawn to move in the Z direction (up and down).
                        I followed the mobileinput tech info from epic... it looks like the attached image at the bottom of this post

                        hopefully that helps... it is pretty much the same as theirs except maybe altered to affect the z coordinate.

                        and yes i can mouse swipe up and down for testing purposes in the mobile previewer, and I didn't alter any script.
                        Attached Files

                        Comment


                          #13
                          Hey Guys! Thanks a ton! I totally missed the link of that stuff ffejnosliw! And Thanks also
                          m00t! You guys rule! If you have time I made another post about anim trees and using the right and left sticks for aiming poses. I made a recent post for tutorial -deacis. Would appreciate it if you could possibly point me in the right direction there also. I am having a blast with this stuff.
                          Cheers!! DM

                          Comment


                            #14
                            Kismet Swipe Doesn't Seem To Work For Me

                            I had a question for those in this thread (and others of course), if anyone had a moment. I am trying to do just a simple "up" swipe in the z-direction in UDK Mobile utilizing kismet. I've followed both examples given by ffejnosliw and m00t, and I cannot get the desired result.

                            For ffejnosliw's example, I can get a swipe up, but the object also moves in the 'x' direction, seemingly due to the 'X Float' in the example, and it just stays in the air at it's final location. Gravity does not pull the object back down.

                            For m00t's example, I cannot get anything to work at all. I've even incorporated the "down swipe" as well, just like in m00t's example, but nothing seems to work. Not sure why.

                            The only differences that I have with each kismet setup are that I'm just extending from the "swipe up" node on Mobile Simple Swipes instead of every node in ffejnosliw's example and both the swipe up and swipe down nodes in m00t's example. I am also trying it with a mobile placeable pawn, but I've also tried with a static mesh and have had no luck.

                            Finally, if you notice the Mobile Simple Swipes in March UDK Mobile has seemed to have lost a couple nodes. Not sure if there's something in there that I'm missing. Oh, and I changed floats around to represent 'Z' instead of 'X', since that is the desired swipe direction, but that didn't seem to help much either.

                            Curious if anyone else is having the issues I am? I am getting reads/comments on screen all the way through my kismet setups and I've tried to alter collision settings (BlockAll, TouchAll, etc.) as well. Maybe fresh eyes might see something I've missed or someone else has had success with the newest beta.

                            Thanks in advance to anyone that might have some input.

                            PS - Shot_01 attachment is following ffejnosliw's example and Shot_02 attachment is following m00t's.
                            Attached Files

                            Comment


                              #15
                              definitely works for me, I still have that incorporated. I did notice as difference, my tolerance is set to 60, and my min distance also has a value of 60. also I have that other float connected through the downswipe - i'm sure you know that and have it disconnected just for presentation here. Also my delay is a result of right clicking on the output node of the simpleswipes - not a standalone delay.

                              my mobile simple swipes does look different than yours though seems I have more lower nodes (touch location x, touch location y, and timestamp).

                              i'm also player only checked, and have it routed through a mobileplaceable pawn, as you can imagine I use it for my object that goes upwards (; it has worked routing through a vehicle as well.

                              i'm not sure why you would have trouble with it. I should mention that i'm somewhat set up in a jazz-jackrabbit fashion so maybe in a 1st person view or something it may not work as such(?)

                              Originally posted by Insipidus View Post
                              I had a question for those in this thread (and others of course), if anyone had a moment. I am trying to do just a simple "up" swipe in the z-direction in UDK Mobile utilizing kismet. I've followed both examples given by ffejnosliw and m00t, and I cannot get the desired result.

                              For ffejnosliw's example, I can get a swipe up, but the object also moves in the 'x' direction, seemingly due to the 'X Float' in the example, and it just stays in the air at it's final location. Gravity does not pull the object back down.

                              For m00t's example, I cannot get anything to work at all. I've even incorporated the "down swipe" as well, just like in m00t's example, but nothing seems to work. Not sure why.

                              The only differences that I have with each kismet setup are that I'm just extending from the "swipe up" node on Mobile Simple Swipes instead of every node in ffejnosliw's example and both the swipe up and swipe down nodes in m00t's example. I am also trying it with a mobile placeable pawn, but I've also tried with a static mesh and have had no luck.

                              Finally, if you notice the Mobile Simple Swipes in March UDK Mobile has seemed to have lost a couple nodes. Not sure if there's something in there that I'm missing. Oh, and I changed floats around to represent 'Z' instead of 'X', since that is the desired swipe direction, but that didn't seem to help much either.

                              Curious if anyone else is having the issues I am? I am getting reads/comments on screen all the way through my kismet setups and I've tried to alter collision settings (BlockAll, TouchAll, etc.) as well. Maybe fresh eyes might see something I've missed or someone else has had success with the newest beta.

                              Thanks in advance to anyone that might have some input.

                              PS - Shot_01 attachment is following ffejnosliw's example and Shot_02 attachment is following m00t's.

                              Comment

                              Working...
                              X