My take on the grappling system (Inheritance)

Prior to this tutorial I have spent at least a year playing with Blueprints.

Firstly, I would make a parent actor called “Interactive object” (Using this in case, i will need to add more parent variables). It will have a boolean called “bCanBePickedUp”.

Secondly, I would make an editable pawn, on the view port I will add a trigger volume in front off the player. When the trigger volumes overlaps actors off the specific class then draw a sphere trace:

Start: GetActorLocation()

End: GetCameraRotation() -> GetForwardVector() * (Multiply by, not pointer) float PushMagnitude (How far you want the trace to go). Then add that to GetActorLocation().

Then check if the hit result actor is that off InteractiveActor. If true, check if it can be picked up. If true, set that actors location to the:

GetCameraRotation() -> GetForwardVector() * (Multiply by, not pointer) float HoldForwardMagnitude. Then add GetActorLocation().

This would be done off button input. The sphere tracer will have to rely on a constant radius and a few other variables (Vectors, bools, FHitResult(https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Engine/FHitResult/index.html), ECollisionChannel).

I’m open to any feedback, I took an ample break from this tutorial and have been avoiding the forms but decided to follow through for once.

I’m not sure about C++ but in blueprint I think a better way of achieving what you describe is to use a blueprint interface which will handle an “Interact” event

Oh thanks Dan, I have finally come back to this series.

I have used BP interfaces prior. However, all the pseudo code I came up with; felt as though I was just over complicating it.

my Default Game Mode has not Game Mod_BP
my version is 4.15.3

then with the crucial button I create a GameMode_BP and also DefaultPawn_BP and get something like this:

Default_GameMode

after that DefaultPawn_BP I have added Grabber component
but my DefaultPawn_BP is inherited from Pawn class instead of DefaultPawn.
what I did wrong can you tell me?

I forgot this photo

You didn’t select the default pawn as your base class
2017-08-04 15_36_10-DefaultPawn_BP

and with it I can access the DefaultPawn, can I?

Not sure what you’re trying to say

purpose is that we cann’t access DefaultPawn because it’s appear only runtime.
therefor we create DefaultPawn_BP for access DefaultPawn. is not it?

Because the DefaultPawn has basic movement set up, so saves having to set that up ourselves.

thank you :slight_smile:

Privacy & Terms