USingleClickTool

[USingleClickTool](API\Runtime\InteractiveToolsFramework\BaseTools\USingleClickTool) is perhaps the simplest possible interactive tool.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

InteractiveToolsFramework

Header

/Engine/Source/Runtime/InteractiveToolsFramework/Public/BaseTools/SingleClickTool.h

Include

#include "BaseTools/SingleClickTool.h"

Syntax

class USingleClickTool :
    public UInteractiveTool,
    public IClickBehaviorTarget

Remarks

USingleClickTool is perhaps the simplest possible interactive tool. It simply reacts to default primary button clicks for the active device (eg left-mouse clicks).

The function ::IsHitByClick() determines what is clickable by this Tool. The default is to return true, which means the click will activate anywhere (the Tool itself has no notion of Actors, Components, etc). You can override this function to, for example, filter out clicks that don't hit a target object, etc.

The function ::OnClicked() implements the action that will occur when a click happens. You must override this to implement any kind of useful behavior.

Overridden from UInteractiveTool

Name Description

Public function Virtual

void

 

Setup()

Register default primary-button-click InputBehaviors

Overridden from IClickBehaviorTarget

Name Description

Public function Virtual

FInputRayHit

 

IsHitByClick

(
    const FInputDeviceRay& ClickPos
)

Test if the Target is hit at this 2D position / 3D ray

Public function Virtual

void

 

OnClicked

(
    const FInputDeviceRay& ClickPos
)

Click the Target at this 2D position / 3D ray. Default behavior is to print debug string.