No announcement yet.

Checking for Touch and Drag to multiple points?

  • Filter
  • Time
  • Show
Clear All
new posts

    Checking for Touch and Drag to multiple points?

    Re-posted the Topic in the Visual Blueprint Scripting Forums, which is located here:

    Original post here:

    Regarding Topic Title: English is not my native language. :/

    Dear UE4 Community,
    dear Android Devs,

    I finally had the chance to purchase UE4. Thank you Epic, for adding PayPal.


    I am preparing to work on a small 2.5 D Side-Scroller Mobile Game with a good friend of mine. I sat down for hours now checking out the Blueprint System, but I am stuck (and clueless) with getting something working.

    We want to have runes in our game, which you have to re-paint with your fingers, in a manner, to destroy the obstacle, where the rune is painted on.

    Now, the thing is:

    We want the player to have to start touching the start point of the rune and follow the lines to each other point of the rune (each rune has 5 points) to be able to paint it.

    Here an Image to show you rune examples:


    The bigger point is always the starting point and from there, you have to go to the other points in order without releasing the finger from the touch device.

    Can I achieve this only using Blueprints? If yes, which approach would I have to take?



    PS: I am using Tappy Chicken as a "Base of Operations".


    Maybe with an invisible box which is being dragged and dropped?

    EDIT 2:

    If this is the wrong forum, then I will re-post it in the proper one or a Moderator might move this topic.
    Attached Files
    Last edited by Maxunit; 06-26-2014, 04:54 PM.

    Sure you can do it in blueprints
    and there are some ways to do it, i will say one that probably is not the best.

    1, know the position of your finger
    You can use a node called " get input state touch"".
    as input you have to say wich finger-N and it will output X and Y of your touch based on the screen size.
    2, Get viewport size!
    is a node that tell you the size of the screen you have, every smartphone have his own resolution so you have to know it.
    3, Define an array for the positions of the points of the rune.
    You know how to make a variable for store a position like XY ?
    lets say we use a vector, and we just dont use the Z ok?
    set it as array, and compile, now go in detail of vector and add 5 items, one for every point of the rune.
    These X and Y will need to be the location of your point of the rune but be careful.
    4 define another integer VAR_Reached_point To set when you reach every point.
    you basically set this to 1 once start.
    check for the Vector_array , using as index the VAR_Reached_point,
    Check input state touch XY are look like the Vector position, if yes , add 1 to Reached_point , otherwise keep waiting the player move right in the point

    Once you start to draw the rune touching the screen.
    you have to put in relation the screen size, and the location of the runes-point.
    basycally you have to put on a % relationship.

    6epend of how you build up your runes and all.
    Lets say you use a widget to show the rune on the screen. (just create a widget with an well anchored image)
    Your rune will always be in the middle of screen, and will be resized to fill at best of screen.
    For every divice, these points will be at different X, Y. (do you follow me?)
    even a point in the perfect middle of the screen will be , for every device , his resolution / 2 .
    So this is the exact relationship that you have to build.

    Build yourself an imaginary grid, to put in relation the
    Input state touch X Y, (that is different for every device) like 1/20 of screen is a universal misure.
    with the screen view (that is different for every device)
    use an array of vectors to keep track of positions
    use an integer to define wich position of the array you want reach/ check