Help with Alterative Adv Direction Object

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

  • Hello again!

    So basically I have two joysticks in my game. I used the example by 'willy' for touchscreen joysticks for android, however, the Adv Direction object he uses breaks the build when I try and export to Android in my version (as in I get a build error).
    The Adv Direction object basically compares the direction of the player's finger and the actual joystick. I'm just wondering if anyone could help me with an alternate way of comparing the directions without using the Adv Direction extension.

    It works like this;
    +Players finger on joystick
    -Set angle of joystick to AdvDirection( "Advanced Direction Object", X( "Joy2" ), Y( "Joy2" ), X( "finger" ), Y( "finger" ) )

    The angle of the joysticks is what controls the player's aim and movement.
    I can also provide the build error log if you want to see it :)

    Any help would be really appreciated!
    Thanks in advance.

  • Eventually you have an outdated Fusion build. Make sure that Fusion is up to date.
    You get the build error only with Advanced Direction object?
    For the error log and similar questions related to Android I would suggest that you use the Android Exporter Sub-Forum.

    This is the custom equivalent of your AdvDir object expression: ATan2(Y( "Joy2" ) - Y( "finger" ), X( "finger" ) - X( "Joy2" ))

    Currently working on ... [SIGPIC][/SIGPIC] ... a Puzzle Platformer

  • Hey thanks so much for the replies both your answers were very helpful;

    alexexhowl - I believe the tool you linked is for gamepad control, I was looking instead for touchscreen joysticks, however I will make sure to use the tool in future for my PC version of the game as it seems incredibly useful for gamepad support :)

    Wodjanoi - this is exactly what I was looking for thanks so much! I also didn't realise my Fusion was out of date and I believe this was the problem, however I think I will use your method, as I like to be able to see and know exactly what each part of my game does, rather than the hidden maths that the Adv Direction object does. Thanks again!

  • Ok guys, I'm unfortunately back with a new problem; the multi touch object doesn't seem to pick up any touches on Android. It works perfectly fine on my PC but nothing happens on Android. I can still interact with buttons I have set to 'On mouse clicked on an object' in the event editor.

    Any ideas as to why multi touch isn't working?
    Thanks again for any help!

    Edited once, last by abcaptain (June 2, 2017 at 6:34 PM).

  • Just so you know Fusion has a built in expression that calculates that ATan2 equation above easily. It's also faster I believe. It's an expression that you retrieve by clicking on your active object > Position > Angle of a vector.

    OAngle( "Joy2", X( "finger" ), Y( "finger" ) )

    Custom A* Pathfinding in MMF2: Please login to see this link.
    Random Tile World Generation: Please login to see this link.

  • So, the calculation with the easy built-in function is faster - that's good to know.
    This was new to me and it's a very useful hint actually. Thanks Sumo.

    Currently working on ... [SIGPIC][/SIGPIC] ... a Puzzle Platformer

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!