how to drag and drop an object?

Sanket Varia 4 years ago updated by Jim 4 years ago 5

So what i want is that when i click and drag on a object, either touch or mouse i want that object to go with cursor. How to drag the object.

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

You need to hold the mouse or trackpad down while dragging and drop on graph. Relevant options should appear after drop.

No i am not talking about the graph. I am talking about the gameobject in game view, I want to drag and move my object in game view. how that can be achieved in bolt?

Ahh, your asking how create a game mechanic to do that in game. Sorry, not sure myself  but I'm sure someone will point you in the right direction.


Is it a 2D or a 3D game?

If it's 2D ... this is not really what you requested but look at this:

I'm using this to make an game object follow the mouse cursor. This is a Super Unit. You probably want to tie this up to a On Mouse Drag event. I havn't done this before so I can't give you exactly what to do, but this is a starting point I hope :D

How did this work out for you?  I'm about to try it out :)