Blueprint Actor Setup

An overview of the Blueprint Actor setup used in the Mouse Interface Demolet

Windows
MacOS
Linux

The Blueprint Actors (MI_Sphere) arrayed within the scene can be moved during gameplay by clicking and dragging with the mouse.

MiSpheres.png

OnMouseOver.png

MovingSpheres.png

In Editor

During Gameplay: Mouse Over

During Gameplay: Dragging

Components

The Components List for the MI_Sphere Blueprint is exceedingly simple; really, it is just a single Static Mesh sphere.

MI_Sphere_Components.png

Construction Script

The Construction Script for MI_Sphere just applies a new Material.

MI_Sphere_Construction.png

Event Graph

The Event Graph for the MI_Sphere Blueprint is where most of the actual work is done. This is where the mouse over, click, and touch events are processed, as well as where the dragging behavior is established. At a high level, the network does the following:

  • Swaps out the Materials applied to the object based on mouse over events.

  • Tells the object to start following the motion of the mouse cursor during a drag operation. This movement is calculated every tick.

  • Stop following the cursor once the mouse button is released.

Click for full size

Of particular importance in the network are the following Events, which drive the mouse interaction:

  • OnBeginCursorOver - This is triggered whenever the mouse cursor moves over a specific object. In this case, the sphere Static Mesh, which is one of the Blueprint's Components.

  • OnEndCursorOver - This gets called once the cursor moves off the indicated object, which, once again, is the Static Mesh Component.

  • OnClicked - This event gets called when the player clicks the mouse on the specified object.

  • OnReleased - This event gets called when the mouse button is released from the specified object.

  • OnInputTouchBegin - This gets called on a Touch event on the specified object, which happens when a player touches the screen on a mobile device.

  • OnInputTouchEnd - This gets called when a player removes their finger from the screen after touching the specified object.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback