Forum rules - please read before posting.

Using AC Touch Input with Gestures

Hi all,

I needed to incorporate some touch gestures in my game, specifically swipes. I looked around AC and couldn't find any extensive gesture support, apart from the tap and drag functions. I ended up using the TouchKit found here: https://github.com/prime31/TouchKit.

It's generally working fine, only problem is it doesn't want to play nice with AC Touch Input. I'm using swipes to rotate the camera from a different script, but if the swipe starts from a screen location that is over an interaction point (hotspot or navmesh), the relevant AC action will also get triggered. This is not something that I want to happen. Is there a way to detect different touch gestures from within AC, and then fire the appropriate function?

Alternatively, I've been poking around the PlayerInput.cs script, and I saw that all mouse click events and touch events are registered on the mouseDown and touchPhase.Began time. Is it possible to use the mouseUp/touchPhase.Ended instead? (Or even better, have that as an option in a future build? :winkwink:)

The way I'm thinking this might work is this: I might be able to set a flag at the beginning of the swipe (which will fire before the mouse/touch up) and then at mouseUp check if the flag has been raised, signifying a swipe, in which case I would disregard the AC action (if that makes sense). Unfortunately, the current implementation with mouseDown kinda prevents that, because even if a swipe is detected, the mouseDown action has already fired.

Any help would be appreciated.

Cheers,
Kostas

Comments

  • My goal with things like this is to empower the user to override AC's way of doing things with your own.  If you're going to make use of your own input system, I'd advise disabling all of AC's so that you can just rely on your own.

    You can use the Engine: Manage systems Action to disable individual systems, like Input, Interactions, etc.  I'm planning to make it easier to look up available functions, but to call an Interaction manually, you just need to run it's public "Interact" function.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.