Ability Nodes & Helpers - Vaei/Grasp GitHub Wiki
[!IMPORTANT] Grasp categorizes everything with
Graspso you can always open the context menu and type "Grasp" to see what is available
[!TIP] A truly complete list of helpers can be found in
UGraspStatics
Common Helpers
Not an exhaustive list
GetGraspablePrimitive() will retrieve the GraspableComponent as a UPrimitiveComponent from EventData. Generally you won't need the specific type.
GetGraspableComponent() is a convenience getter that will output your derived graspable component, saving you from having to manually cast it
FindGraspComponentForActor() will attempt to find a PlayerController from the given actor, then retrieve the UGraspComponent from it. There are similar matching functions if you know the type beyond it being an Actor.
FlushServerMoves() and FlushServerMovesForActor() will consume and clear any CMC PendingMove, a very common action we require when doing anything that affects movement, otherwise CMC's move combining can cause us to teleport or de-sync.
IsWithinInteractAngle(), CanInteractWith(), and many similar functions for testing against our UGraspData parameters
GetScreenPositionForGraspableComponent() is useful for positioning a UI screen space widget over a world space component.
Ability Tasks
Face Towards (Grasp)
This is a Root Motion Source that will rotate your character to look at the GraspableComponent you're interacting with. Or anything else you choose to pass it instead.
While active your character can not move.
Cardinals
Montages
It is common to play a montage based on the cardinal direction, e.g. left, right, forward, backward.
Get the cardinal direction relative to the interactable, i.e. so we can move forward towards it, backwards away from it, to the left of it, etc.
You can also get the opposite cardinal instead, for example if we want to move away from instead of towards the interactable.
Forces
You can also snap a vector to a cardinal direction, this means you can reduce the potential directions into 4-way or 8-way. This can be great for ironing out the minor differences between server and client.
[!WARNING] There is a very small but possible risk of the minor difference resulting in a different cardinal