Inventory of An Diferent Game

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.

But i have a job for my College (game designing) and i have no choise. i need to do this =( Ty

I’m not going to do your homework/write your code for you, but basically you need to display your inventory using the gui system:

http://unity3d.com/support/documentation/Components/GUI%20Scripting%20Guide.html

Then instantiate a new prefab of your object when and where the button is clicked:

http://unity3d.com/support/documentation/Manual/Instantiating%20Prefabs.html

http://answers.unity3d.com/questions/7676/how-can-i-instantiate-a-gameobject-in-mouse-position-and-in-a-special-distance-fr

Thx man that’s help-me alot =)

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

There is a script in this thread that you might find useful as a starting point, although you’ll probably have to modify it quite a bit.