Hello, i’m trying to make a game have an inventory(stays at horizontal button of an orthographics cam) with starts with itens then u click on the iten, the iten apears in the mouse arrow then u drag to wherever you can the click again to let the iten drops on the flor.
I’m not realy good on Scripting i’m only a begginer, and don’t have anything to starts this scripting. Any help i’ll apriciate.
Ty
ps:(i’m sorry about my english i’m from brasil =))
Well, if you’re only a beginner and not really good at scripting, then perhaps you should start with something that doesn’t require a complex, drag and drop inventory system.
I’ve been programming for 30 years, but my first Unity game was still Pong.
Hello
I’m realy trying hard but the most i can do is this
var Trap1 : Transform;
function OnGUI () {
if (GUI.Button (Rect (50,500,110,70), "I am a button"))
{
var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
var hit : RaycastHit;
if (Physics.Raycast (ray, hit))
Instantiate(Trap1 , hit.point, Quaternion.identity);
}
}
With this code my button is creating the object called “Trap1” but he creat in the position of the button and don’t follow the mouse like a drag button,
i tryed the drag scripting but he don’t realy stay in the mouse arrow.
I need some help. plzzzz