How would I put down the picked up object only on a certain place?

The title says it all, for now I have implemented a pick up system where player can pick up the object he is looking at if he is close to it. But I haven’t implemented putting the object down because I only want the object to be put on a certain place and I don’t know how to do that. (For example, I have a cup that is picked up, I can only put down on a tray, so if the player is looking at that tray and presses the same pickup key, the cup should be placed on the tray). Is there an easy way to do that?
Here is my pick up blueprint

I have thought about getting names of every object the player is looking at, and when the name of the object matches “tray”, then I spawn the object on it. But it is hard to get names of every object I look at and keep doing that for the entire game.

It looks to me that you have an “interaction” instead of “pick-up” system which is better. (although it has a few unnecessary bits)
In that case when you “interact” with the cup you actually pick it up but when you “interact” with the tray you place the cup on a specified location on the tray.

You just have to find a way to define what exactly you what to do when you interact with the object and there are a lot of ways to do that. You can change the behavior depending on the object you are pointing to, or depending on weather you already hold something, or maybe on both.

I was thinking when I press the button of picking up and I already have a picked up object, then it test what the player is looking at. if it is tray then it put the object on it, if not then nothing happens.(I’m thinking about checking the tag of the looked at object if it is “tray” then it is the target). but how can I actually make the cup be placed there? and is my concept good or not?

Your concept is solid in my opinion.

Depends on what do you want the cup to actually be…

I see that when picking up you get the cup’s mesh and assign it to a (presumably) empty item mesh component in your character. You can use the same approach with the tray. If the InteractionFun() also takes a character as an input parameter you can directly in the tray decide what you do - “does the character holds something I can use and if so assign it to my empty mesh component.”

This approach will make the tray and the cup to become the same object though and it comes with some constrains.

The other thing you can do is get the tray position and spawn a cup actor just above it. You can assign the cup actor the same mesh that the character is holding. To better position the cup you can create an empty scene component in the tray (cup-holder, pun intended :wink:) and use its position as a place to spawn the cup actor. This starts to become complex if the tray is in some strange orientation but you’ll have to decide what should happen there. Maybe you can’t place a cup on it if it’s upside down or smth.

Now I can’t see from your graph what happens with the cup after being interacted with. If it’s just hidden or you have it somewhere you can just move it (teleport and show) instead of spawning a new cup.