Need help with dropping actor / seperating actors within BP

Hey Everyone,

I am trying to make an openable drawer with a file actor inside. I have managed to make the drawer work and am able to pick up the file mesh however, I am unable to get the drop item code working correctly;

Character BP:

Drawer Event graph:

Drawer-File pick up function:

Drawer-File drop function:

I am of the opinion that the file wont drop because its not set as the scene root, however if I were to do that the rest of the BP would stop working (drawer movement).

The reason I think this is becuase the pick up and drop functions work fine on individual actor BP’s;
I believe there is a way to get the drop function working, I just cant see it.

Perhaps there is a node or set of nodes that will allow me to focus just the file actor?

1 Like

Haven’t tested it, but maybe a DetachFromActor node or a DetachActorFromActor node would work?

1 Like

What exactly is happening here? Are you getting errors? Or is it just not dropping/simulating physics on the file actor? A little bit more detail would be helpful.

Have you set the static mesh to movable? Is it using correct collision settings? Also, maybe try setting the collision before simulating physics, not really sure about this one!

1 Like

@DavidNixon Im actually using DetachFromActor node on the BP’s for items that can be picked up around the scene, doesnt seem too work when I use it in this case though.

1 Like

@isikdev So the drawer is operable and the Pick Up function is working correctly so I am able to pick up the file out of the drawer.

However, the issue is that the Drop item function isnt working so the file is stuck as being equipped.

The function works on individual actor blueprints e.g I can pick up and drop a machete in my scene; I have tried incorporating that code into my drawer BP and so far, its only the drop item function that isnt working, hope this makes it a bit clearer.

1 Like

You may want to use a workflow that, instead of Detaching from component, deletes the file mesh component and spawn an actor in that world transform with the same file mesh, simulated physics, and collisions settings.

2 Likes

Exactly what I was thinking. Not the cleanest way but I’ve done this many times on my projects and it works like a gem. A lot easier to implement as well!

2 Likes

Yes, indeed, and you can make the spawned actor’s mesh a variable that reads the file mesh from the drawer. So, you have a procedurally generated actor spawner. This technique is used for spawning arrows or bullet cases. Glad it helped.

Thanks for the sound advice, Im very fresh Unreal so I’ll see how far I can get! :rofl:

Not exactly what you want but similar logic here on something I’m working on. NPC dies and drops an item that must be specified, from my item list:

For your case, I’d go about it something like so:

Best of luck =)

1 Like

So I have tried implementing that code with the pick up interface I’ve set.

I’ve set up a new input specifically to handle dropping items out of drawers:

In the event graph, the drop component BP interface calls the drop item function:

In the drop item function I have implemented the code you suggested:

To my untrained eye I dont see why this shouldnt work. The logic makes sense but something just doesnt seem to be adding up.

Got it. You forgot to connect ‘destroy component’ and Set Visibility. The flow was interrupted.
Hope that helps.

hasnt affected the result unfortunately :astonished:

Hmm, getting any accessed none errors or nothing at all?

I got it now. If you destroy the file component, ‘set visibility’ will return errors. So, second node is not necessary. Try connecting destroy component to spawn actor from class.

Not at all, I wonder if its a deeper problem with how the interface operates with the BP? I can see that “Event Interact With” fires off in the even graph but when I press the key for “Even Drop Component”, nothing highlights as if its not even getting to the drop component stage?

hmm still doing the same, maybe the problem runs deeper like I mentioned to IsIkdev in the last reply

Try to add ‘print screen’ nodes in the drop item event to see if something is triggering correctly. And review your entire flow.

1 Like