Click and Drag

Will someone explain to me how to set up a blend where you can use the mouse to click and drag objects in the game engine?

Anybody?! Surely someone has done this.

I’ve made a simple blend, modifying the script from a setting slider in my Air Hockey game, that sets the cube anywhere along the ground with a z axis of 0. If you know a little python you can change the script easily and change what axis it sets the cube at. The plane is there so you can click on the plane and the cube goes there.

If you want a 3d drag and drop, that’s going to take a little more Python. You’d have to get the distance from camera to object, and be sure when you set the object it stayed that distance. You’d have to figure out some math and such, but it’s possible.

Edit: If you read the first paragraph before, I’m sorry. I read the date wrong. Please forgive me!


dragndrop.blend (134 KB)

I’m very sorry and yes I do agree, this forum is great massive help for people wanting to learn Blender. And I figure since it’s been 3 days I might make it active again to the front page. Usually I’d go for a week to get responses and I’m aware of double posting. I’m not trying or wanting to be mean in any way. And I thank you for the blend. I’ve been a little eager on getting things done here latley and once again I am sorry for that.

No its my fault, because I read the date wrong. 00:39 looks a lot like 10:39, so I thought it was 10:39 and then 10:42 on the same day of your two posts. It was actually three days after I looked a lot closer. I didn’t realize it had been that long. Before I posted I looked several times, and I still thought it read 3 minutes in between.:frowning:

Hope the blend is helpful!

It’s okay I forgive you :slight_smile:

Your blend is NEAT! Like Simulation or Strategy kind of click and drag. It is indeed helpful for my future purposes! But now I remember seeing Half Life 2’s Gravity Gun and I’m going to try that out now too. But anyways thank you very much the blend file!

If you need any help with it, just shoot me a PM. I looked it up on Wikipedia and it looks pretty fun to make.

Well the thing is it’s already made I just can’t FIND IT! I’ve seen it before not really Gravity Gun but the Physics Gun. I have seen in it just in someone’s FPS before and then I deleted it :frowning: but I have it in an edited version of Cray’s Third Person Template but yet I can’t set it up in the right way. So pretty much now I’m searching just the FPS version of it.

Found it! It was at the Game Blender forums! I haven’t checked that site in a while, I need too for things that I’m doing. Well here’s the link.

Here is a blend example I made and give to all the drag and drop people.


Drag & Drop Example.blend (146 KB)

Thanks Sunjay!