Hello, i want to make a similar system for putting items on a shelf like supermarket simulator for a project where you need to put certain items on a shelf to solve a puzzle i got this part down for the puzzle but the putting the items on the shelf is what im having trouble with, i would need it to when i press left mouse button it would make sure the spot isnt already occupied then put the items on that section eg with a socket or a placeholder Can anyone help been stuck on this for days now - if anyone already implement this system that can shere game folder with this system in or send over blueprints of this system would help me very much thank you!
You need to check if the object you want to put touches anything (except the shelf). To do this, use GetOverlappingActors.
To make the object “stick” to the shelf, use Line Trace from the camera and a little ahead of it to determine the location of the object.
If objects can only be installed on a grid, then you need to find the grid point closest to the Line Trace hit point, install the object in it and perform a check after that.