Ideas on grabbing

  1. Component or inheritance?
    Components. Any AActor can potentially be moved. It would be very convenient to be able to add a component like Handle so that an actor can be grabbed.
  2. How may you know what to grab?
    We could attach a volume to the pawn dynamically (somehow maybe …). We could move it with the pawn and turn it in the direction of pawn’s view, so that it’s possible to check if it intersects with an object. In case it’s an object with Handle, then we can store it, and then change it’s position when the pawn moves.
  3. What game objects would you be working with?
    A pawn and a volume.

it’s pretty spot on for your ideas. I’m not super pro yet with C++ side of things, but another way you can use a trace to fetch item in front of view instead of trigger volume. So you can adjust how far/close you can grab when object shape is irregular.(trigger volume only have those fixed shapes available to you.)

On the other hand of things, since we might want to filter object in the future(so you don’t accidentally grab and move a wall. there needs to be something on the actors that are grab-able when we use the trace method, if a component or actor that implement and inherit a volume setup, then we don’t need to filter(cause they could be grabbed once enter volume.)

Pros for trace, it can be implement on pawn side only and filter with either tag or interface from actors that can be grabbed.(which haven’t mentioned in lecture so far yet.) You don’t have to create volume that fits to a shape, and don’t have to worry if your pawn overlap 2 items at the same time of those actors are placed really close to each other.

my 2 cents.

Thank you for the advice. It turns out that your approach is exactly what Ben describes in his video, so I’m following it :slight_smile: I find it really fascinating to debug things visually, like REALLY visible debug lines :slight_smile: I’m used to numbers and strings, and now it’s totally much more fun that usual.

This was an intersting read. I will add my ideas here (instead of adding a new item :wink: ) . My Ideas where a little more high over! I liked the specification you used! I am just at this point of the training now, so no spoilers :-p

My Ideas:

Add a component to the Pawn.
I am sure this can be done, however up until now we have done it to objects that are outside the PlayerController, so it will be interesting to see this work.

Use the TickComponent that checks if you are in the area of a static mesh object (oeps just saw that walls are also static mesh objects. So adding a boolean to the objects is a good idea.
Why this magnet function? I would like to have some kind of interaction where the player needs to click to pick it up or something. (As you see in other games)
What happens if there are 2 objects. Drop and pick up or pick up both. This is why I would like a button press action. Also I am interested in those.

Inhert from Unreal Engine and use a build in function to pick up the object. When you are close. Like the TriggerVolume

I hope these ideas make sense to you guys :slight_smile:

Privacy & Terms