Hello everyone, and happy new year ! Wish you the best for you all.
I have actually made a** BP** into my topdowncharacter_BP(not 100% finished yet) to **grab **& **drop **object, but now i want to be able to drop this object to a specific point in another BP.
---------------> For exemple in the game : If i have some wood grabed in my hand, and if i have a BP āstorageā (like a wood rack), i want to be able to** put this wood grabed** into a specific socket into the **BP āstorageā. **(PS : i know that i can add sockets in a BP)
But i have noo idea how to make it work
@Krystoh I think the easiest way to do that would be with BP interfaces. That way, the execution can always be contained within the BP that is āgettingā the object.
In fact, it would probably be best to destroy the actor and spawn a new component in the āacceptingā BP.
So when the player uses the drop action, a line trace can āseeā the relevant BP and call the interface saying āhey I just dropped something on youā, then the BP can take any appropriate action:
@ClockworkOcean Thank you a lot for your help, i donāt exactly see what you mean because iām a beginner (even if i saw more than twice the video on your link), but iām trying to find out and i will post here when itās ok ! (or not ^^ā)
When you press that key do a line trace and find the log pile
Send a message to the log pile using the interface that says āHey, Iām dropping a log hereā ( and give the reference to the log actor )
The log pile understands itās a log and spawns a new log in the log pile and deletes the actor
If you have tried to drop a log on something that was not a log pile ( but did implement the interface ), it would see the object type was wrong and do nothingā¦
Thank you a lot @ClockworkOcean for your precious help, while you was writing iāve found a solution, itās not exactly like you said (i will try your solution also, to learn & also itās maybe better), but anyway just to show you and also in case it can help someone else here (in the same order of the first pictures) :
Iāve not finish at all yet, but itās (80% ?) functional.
Also i know itās messy and not optimized, also i think itās not the better and easiest way to do it, but iāll do better.
**Iāll be glad to know if you have any comments, advice, help.
Thank you again for your time and for your help !**
Good to hear youāve got it working, but I think you might have it back to front ( excuse me if Iām wrong ). So you have F just to pick up the thing, you walk to table and click, but when you click it your character can also send a StorageEvent and inside the table it actually has this event ( a red node ) which handles the event.
If you do it that way, the code to have StorageEvent can be different for every BP, because the code is IN the BP, not in your personā¦
Oh, please told me if i misunderstood, but actually the code is already in the storage BP (last picture).
The character have the grab & release (with variable boolean āHoldingā & actor āgrabed objectā), and the storage BP contain the code who able to storage the grabed object if the player holding it & if the player click on the storage (the table).
The RED node is the receiver, that goes in the BP. The BLUE node ( the sender ) goes in your character
( Because your character will always send the message, and the BP of whatever kind will have to figure out what to do with the message, at the moment you have the log pile sending the message to your characterā¦ ).