- Home /
clicking the right mouse button and add an object
clicking the right mouse button and add an object type sims 2 or 3 that system to add objects in the house and in town please i await reply.
Answer by VTW · Feb 13, 2014 at 06:04 PM
Your question is incredibly vague. Based off of what I know from the Sims, you want to be able to right click to get a context-menu of sorts, and then a left click on that context menu will create an item?
Or you want to have a catalog in the pause menu (the last Sims I played), click on that and then click again to place into the world?
Either way, you're going to need to research the following: Input (for detecting mouse clicks) GUI (for drawing context menu or pause menu) Object modeling (Blender is free) Prefabs Object instantiation (see Instantiate command)
These few things are the very least of what you'll need to do. You'll likely need active collider detection for object placement.
how so? I already have the objects I just wanted the script menu click the image of the object and be able to click on the ground and the object appear where I clicked.
sorry english my braziliam.
So the entry you click on from the script menu will fire an event once you click on it. Within the fired event you will instantiate the object, and constantly update it to center on the mouse position. Once you left click somewhere, a check should occur to see if the object you've instantiated and locked to your mouse is colliding with anything other than the floor. If not, set the coordinates to where the mouse clicked, ensuring that the object's coords don't go through the floor (more logic).
Your answer
Follow this Question
Related Questions
How can you use an object as a button 0 Answers
Activate Object in a Certain Distance 2 Answers
how to control player movement with ui buttons? 1 Answer