Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition
by John P. Doran, William Sherif, Stephen Whittle
How it works...
We create a new Actor class and add a box component to give the actor something that will collide with the character. Alternatively, you could subclass AVolume if you wanted to use the Binary Space Partitioning (BSP) functionality to define the volume's shape (found under Geometry in the Place section of the Modes tab).
NotifyActorBeginOverlap and NotifyActorEndOverlap are overridden so that we can perform an operation when an object enters or leaves the AntiGravityVolume area.
Inside the NotifyActorBeginOverlap implementation, we attempt to cast the object that overlapped us into an IGravityObject pointer. This tests whether the object in question implements the interface. If the pointer is valid, then the object does implement ...
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