Im looking for ideas and strategies for making icons drag and dropable from GUI to in world objects. Imagine you have a camp fire in the world and want to drag wood from the inventory to the camp fire. I dont even know where to start looking. Any tips?
Take a look at the Camera method.
Click here and take a look how the tutorial does the point the the object in scene. You’ll have to use the camera method to specify the location where your mouse is pointing (which object)
Got the idea?
I think so. Even if your LMGTFY-link doesnt seem to make sense. Thnx
sry about that. I hadn’t time to search it.
Now i remember: Walker Boys Studio Tutorial
There is! hope it helps.
Are you kidding me? There are hundreds of videos on that page. I looked at three of them titled something with GUI and they had nothing about drag and drop. ![]()
We get only some parts of what we want and put them together. In this case, you can get the resource where him click and the object is destroyed.
I’d change this part to adapt your necessity to “Drop the object in the World”. the Drag part idk how to do. sry.
When you click on the icon from your GUI instantiate a new one and have it stick to the mouse position as long as it’s held. when you let go of the mouse you can use a raycast (I think it’s called ScreenPointToRay) to figure out where you are dropping it and instantiate a prefab there. If you plan on having the dropped items interact(like adding wood to an existing fireplace) you should think about putting a hover over tool tip on any item that the dragged icon’s item can interact with.