Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition
by John P. Doran, William Sherif, Stephen Whittle
How it works...
We create three functions inside the Selectable interface. IsSelectable returns a Boolean to indicate whether the object is selectable. You could avoid this and simply use TrySelect, given that it returns a Boolean value to indicate success, but, for example, you might want to know if the object inside your UI is a valid selection without having to actually try it.
TrySelect actually attempts to select the object. There's no explicit contract forcing users to respect IsSelectable when trying to select the object, so TrySelect is named to communicates that the selection may not always succeed.
Lastly, Deselect is a function that's added to allow objects to handle losing the player selection. This could involve changing the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access