Plugins: Gesture Recognizers & Look At Movement Component

I’ve been meaning to package some functionality from up into plugins so non-C++ UE4 developers could benefit from them, and I finally found some time to do it.

Here are the first two plugins carved out of the code. One is a set of Gesture Recognizer components, the other is a simple movement component for keeping an object oriented at another object.

The source code for these two plugins is available here: on Github.

Any future UE4 plugins we release will be added to this repository.

Look At Movement Component

This plugin adds a new movement component that can be added to any actor. This movement component will cause the object to always orient itself toward the local player, another actor, or a world location.

Although the look-at logic is fairly simple, we found ourselves repeatedly implementing the same logic to orient a turret, camera, or other object toward the player or another actor. It seemed logical to wrap it up into an engine plugin so that the logic would exist in just one single place.

Use:

  1. Add the Look At Movement Component to an actor.
  2. Configure in the inspector to specify whether the actor should look at the local player, another actor, or a specific world location.
  3. There is no step 3. You’re done.

Installation: Unzip the package into the Plugins directory of your game. To add it as an engine plugin you will need to unzip the module into the plugin directory under where you installed UE4.

Note: binaries for Windows 64-bit and Mac OS X are included. If you want to use it on any other platform, you’ll have to compile yourself.

Download: https://dl.dropboxusercontent.com/u/5075634/LookatComponentPlugin.zip

Mobile Gesture Recognizer Components

This is a set of gesture recognizers for touch devices, implemented as Blueprint-spawnable actor components that can be attached to any character, pawn, or other actor. These recognizers correctly take into account the screen resolution and scaling factor. The following gesture recognizers are available and ready for use:

  1. UTapGestureRecognizer - a “smart” tap recognizer than can recognize multi-taps (double, triple, etc) without triggering false positives (e.g. no single-tap when double-tap happens), and also supports multi-finger taps (e.g. two-finger double tap).
  2. UInstantTapRecognizer - a not-so-smart but fast recognizer that tells you when any finger touches or leaves the screen. Useful when the delay needed by UTapGestureRecognizer for recognizing multi-taps might be a problem in terms of game play
  3. USwipeGestureRecognizer - a smart swipe recognizer that can recognize horizontal, vertical, diagonal, and edge swipes.
  4. UPanGestureRecognizer - allows you to get notified when fingers move on the screen. Works well, but right now, only a single pan recognizer can be used reliably.

The following gesture recognizers mostly work, but still needs some love:

  1. UPinchRotateGestureRecognizer - A gesture recognizer that notifies when a two-finger pinch or rotate gesture is happening

Future plans include moving the touch-processing code to a shared class to reduce redundant processing and improving the pinch/rotate gesture.

Installation: Unzip the package into the Plugins directory of your game. To add it as an engine plugin you will need to unzip the module into the plugin directory under where you installed UE4.

Download Link: https://dl.dropboxusercontent.com/u/5075634/GestureRecognizerComponentPlugin.zip

Note: binaries for Windows 64-bit, Mac OS X, and iOS are included. If you want to use it on any other platform, you’ll have to compile yourself. I’ll be adding Android binaries shortly.

Feedback, suggestions, and bug fixes are welcome.

I did a short video showing how to install and use the Look At Movement Component:

I’m also working on one for the gesture recognizers. Those are more involved, though, so it may take a few days to finish the video.

Finished the Gesture Recognizer video. Shows how to install it and basic usage of the gesture recognizers:

The Win64, MacOS, and iOS binaries have all been updated to reflect the most recent code. I also added Android ARM7 binaries today.

Cheers ,
This is a real time saver and one less repetitive thing I need to worry about (thumbsup)

You should submit this back upstream via a GitHub Pull Request so a larger audience can potentially benefit from this plugin if it’s accepted into the UE4 codebase.

P.S. I’m glad to see is making good headway (I just checked your your forum thread + subscribed to your newsletter), now I feel guilty for not checking in on the project for several months (subscribing to [WIP] - Game Development - Epic Developer Community Forums now) as it seems like I’ve missed some pretty epic art/feature drops :open_mouth:

Benjamin:

Thanks for the kind words. We’ve been kind of radio silent on since getting back from WWDC, but hope to get back into the update groove before too long.

Thank you . Totally awesome! fyi: 2nd video is marked as private. I cannot view it.

Sorry, fixed.

Works great ! As an incredibly novice programmer, and someone new to ue4, AND someone trying to quickly and easily implement swipe this is a GREAT and easy solution. There have been 3 solutions on these forums that I’ve discovered over the past few weeks, and this is by far the easiest to work with (others required visual studio or complicated blueprint coding).

And that video of the gun turrets systematically demolishing those people lined up in a row is hilarious. I love it. So fun to watch.

Wow ! Impressive and really usefull work, I’m pretty sure I’m going to use that on future projects. Thanks :wink:

thanks , do you have any plan to add windows multitouch support on your plugin ?

This is awesome, thank you for submitting this to ue4!

much appreciated . thank you

vrMan - I’m honestly not sure what that would entail. The touch-detection stuff is abstracted by the engine so, in theory, it should work on Windows devices with touch screens. I’ve got a Surface downstairs so i can test it out.

I probably should generate a Windows32 bit version of the library. I’ll see about doing that this weekend if I can find time.

I really like that Look At Movement plugin, is there any chance you could add an option for it to follow the cursor? This could be useful for side scrollers and/or top-down shooters. Also, another thing that would be nice to see would be the possibility of “lag” similar to that of the Spring Arm has. Slowing it down a bit would be absolutely perfect for turrets so it’s not on target all the time.

I plan to add a rotation speed. I’ve already implemented that in our turrets, so just need to adapt it to the plugin.

I hadn’t really thought about looking at the cursor. I’ll have to investigate what’s involved in that, as the cursor is disabled on the stuff I’ve worked on.

unfortunately there is no windows multitouch support in unreal , but it would be great if someone make this as plugin

Oh, that’s… surprising. Out of curiosity, have you checked this in 4.9? I noticed that they added Microsoft Surface to the list of preview resolutions in UMG in 4.9p2. That doesn’t necessarily mean they added touch support for the Surface, but it certainly means the device is on their radar. We’re now on the second fully-touch capable major release of Windows, so it doesn’t seem like touch support can be too far off.

Doing this as a plugin would mean adding platform-specific code for my weakest platform :-/ I’ve built native apps on many platforms, but I haven’t done any native Windows programming in years… at least a decade, and realistically, about the time I end up figuring out how and coding it, Epic will have added it to the engine.

Nice Job! can’t to see what other plugins you do in the future keep it up!

Hey, the look at component is great!

I’ll throw a feature request on the pile: It would be super cool if you could isolate which axis the component is rotating about. It’s a thing I’ve needed in various games and 3D projects over the years.

Thanks for sharing!

Hey, Alan! Thanks for the suggestion. That sounds like a great idea. How would you envision it working from a game dev perspective? A checkmark in the inspector for each axis that says whether rotation is allowed on that axis?

I’m hoping to revisit the code for these this weekend and also get my offscreen indicator packaged up into a plugin, so let me know how you think it should work and I’ll add it when I next work on it.