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:
- Add the
Look At Movement Component
to an actor. - Configure in the inspector to specify whether the actor should look at the local player, another actor, or a specific world location.
- 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:
- 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).
- 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
- USwipeGestureRecognizer - a smart swipe recognizer that can recognize horizontal, vertical, diagonal, and edge swipes.
- 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:
- 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.