- Home /
Multiple technical questions
2D drag and drop a texture
Hello, I want to make a menu at the side of screen and when I press on a button in the menu I want that it shows a texture at the mouse and when I press again on the map that the texture is now there as a fixed texture. And then when i want to have a block that i cant place a other texture on the same position. Can somebody tell me how i can do this
This sounds like a recipe for someone to write some code for you. You have multiple technical problems with multiple different ways to solve them. Unity Answers is designed to answer single, specific technical questions.
Start by researching
Camera.ScreenToWorldPoint() - track the mouse
Instantiate() - create the texture
Prefabs - store the texture for creation
On$$anonymous$$ouseDown() - signal a placement
Physics.Raycast() - check for collision
Physics.CheckSphere() - check for collision
GUI - make the menu
As a first step, try creating a texture and get it to track the mouse.