pick up and drop with line trace



not work

Explain how it should work. There are some strange bits in the script - not sure what the purpose really is.

I want to pick up the object (box) that I’m looking at (and have it stay in my hand) and then drop it on a bluepint actor

1 Like

What does this mean? Place it anywhere in the world or only on top of a specific actor?

this
image

That does not help. Can we drop it ONLY in the trigger box?

1 Like

yes, I know I don’t explain myself well but I want to take this box and place it inside this blueprint actor

I’m going to record a video and pass it on to you to see if you understand it better.

  • we cannot drop the object unless we line trace the box, right?
  • when you say on top, you mean inside?
  • are we using physics?
1 Like
  • we cannot drop the object unless we line trace the box, right? yes
  • when you say on top, you mean inside? yes
  • are we using physics? If it is not necessary, it is not necessary
1 Like

like this but taking the one I’m looking at (I don’t know why I got that one specifically) and leaving it inside the blueprint actor where the arrow is, everything with line trace

See if this clarifies things a bit:

  • interface function returning an enumerator and actor reference:

  • line trace interact with the pickup:

  • line trace interact with the box:

image

  • input in the pawn:

  • result:


This can be made much simpler but I sense you will want a system that can expand a bit since you have a bunch of shelving units in the vid. Hard to advise better without knowing the required features but what is suggested above should be agnostic enough.

See if you can implement something similar.
Good luck!

1 Like

That’s incredible and that works with several? I want to be able to pick up a box and put it in and then pick up another one and put it in.
image
image

Apparently:

But, ofc, more will be needed. You can probably drop stuff on target spot that is already taken, and you will be unable to pickup items that are dropped. The dropbox actor btw since I forgot to include it:

Reacts only to Visibility channel - that’s the setting to manipulate if you want to pick up items again. The whole thing can be done more organically / logically - but we’d need to know how the rest of the system is supposed to work. I’d leverage the interface more, for sure. Or even encapsulate the pick up / drop behaviour in a dedicated component so it can be added to all sort of actors.

1 Like

How did you put pickup there? Or am I in the wrong node?
image

Create your own enumerator that describes the object types you have in the game:

image

image

You can then use it as a variable anywhere. You can also include it in the actor as an Instance Editable property, so every item has a unique value even though they share a class.

1 Like

I suppose the trace function that you have in the pawn would be something like that, right?

1 Like

Yup, UE v5.3.2 project:

1 Like

you are incredible!!
One more thing, imagine that I placed the delivery boxes inside a shelf actor blueprint, should I change the shelf collisions too?

Depends - that’s more of a gameplay feature question for yourself as a dev.

  • first of all, is the collision of the shelf complex? or is this just one big box?
  • do we want to prevent the player from placing boxes through the shelf frame?
  • or do we want to be super precise? Note this can get annoying for the end user.

If we only care about about placing stuff and can ignore trace interaction with the shelf itself, you might as well set the shelf to Ignore Visibility traces. It will still block player movement but will not respond to trace queries.


Is this going to be some sort of shop / warehouse / quartermaster simulator?