Navigation
API > API/Plugins > API/Plugins/ScriptableToolsFramework > API/Plugins/ScriptableToolsFramework/UScriptableSingleClickTool
Description
Click Support API TestIfHitByClick is called to allow the Tool to indicate if it would like to consume a potential click at ClickPos. The Tool can return yes/no and a "hit depth", which will be used to determine if the Tool is given the click (ie if it has the nearest depth), at which point the OnHitByClick event will fire. The default TestIfHitByClick implementation always captures the click (at depth 0).
Note that this function will be called twice for a particular hit - once on mouse-down and once on mouse-up, and if it returns no-hit on mouse-up, the click will be "cancelled", similar to standard GUI click interactions.
| Name | TestIfHitByClick |
| Type | function |
| Header File | /Engine/Plugins/Runtime/ScriptableToolsFramework/Source/ScriptableToolsFramework/Public/BaseTools/ScriptableSingleClickTool.h |
| Include Path | #include "BaseTools/ScriptableSingleClickTool.h" |
UFUNCTION (BlueprintNativeEvent, Category="Click Events")
FInputRayHit TestIfHitByClick
(
FInputDeviceRay ClickPos,
const FScriptableToolModifierStates & Modifiers
)
a FInputRayHit indicating a hit (true/false) and the hit depth along the hit-ray (0 for "always consume")
Parameters
| Name | Remarks |
|---|---|
| ClickPos | the position of the click, including both a 3D ray from the eye, and (optionally) a 2D mouse position |
| Modifiers | current modifier key/button state |