gravity gun

in a half life 2 video clip i saw a gun that picks up objects. Is there a way to make one of these guns in blender using only logic bricks that picks up things with a property of ‘small’?

Could you set it up so that the “small” objects have their own controls, that only work when the gun is near them? I think that’s as far as you’ll get without Python.

[keyboard]
[near] [AND] [Moving controls]

well its actually supposed to happen when the gun is shot at them. So maybe i could use ray or something?

Actually I think to make this effect of a gravity gun really cool, you should use python.
A long time ago I had the idea to make a tornado grabbing objects and such, and Siegel made a cool demo on this. A tornado controlable with arrow keys to move it around in the ground and let it grab objects in range.

http://www.antihc3.dyndns.org/gameblender/ftp/tornado.zip

With modification you can make a gravity gun using this script, and I’m sure about that.
have fun with it, ooh I don’t know if it works in 2.4, but it did in 2.37 :stuck_out_tongue:

I’m sure there’s a better way, have a object shoot out of the gun, then upon collision have the object move upward. You will have to give them a property name with it.

ok can someone tell me how to do this:

the gun will shoot a beam. When this beam collides with an object with the property ‘small’, the player will be in control of that object until he lets go of the shoot button.

thanks.

This would be easily possible to have if there was a parent sensor implanted hint :wink:

I think you could do it so the object sets it’s property to True when it gets hit, then when the property True is set, it will track to a empty in front of your gun, and dloc forward. You may need to have it when it’s near the empty it’ll stop moving, otherwise it could start shaking when it hits the empty.

I did something similar some time ago for mi game zero consequences, do you remember? when I grab the barrel and put it in the elevator and make it explode when going dow [>]

Here is the video

http://salvador.mata.com.mx/zcon2a.rar

yes thats what i need. How did you do that?

you can use the way of making an Object follow an other

lets call the gun A and the barell B

A sends message to B that make it

1-go forward with L enabbled ,
2-editobject> trackto B to A , then B will fly to A

… if you want a blend file send me a PM and i will create a blend file and a video tut …

note : that idea is mine and i have tested it and it worked

Make the object have a proprety, called ‘Control’.

The GravGun shoots a small contraption, that upon collision sets the ‘Control’ prop to ‘1’. When Control=1, and keyboard ‘W’, then move box.

It’s pretty simple, but it doesnt work perfectly, for example, the axis of the box wouldn’t always be the same as the player.

yes, thats the problem…

Actually, i just figured it out.

Just have the object that you are… Lets say ‘Gravitating’ and make i track to you. So you can move the box up and down with the Global Z Axis, and push it back and forth using Local Y Axis, and left and right on the Local X Axis.

but i need to be able to rotate it. look at mattai’s video.

Hello :slight_smile:

I´ve used two simple scripts, one of them to get the position and orientation of an empty parented to the camera, then when the player comes close to another object active for grabbing and some key is pressed, you assign to the object the orientation and position you got before.

this is the basic logic, you can improve ir a lot :wink: , by the way I would like to see some pics of your work :slight_smile:

I’m writing some tutorials about the B Engine, maybe will be ready soon in mi blog :wink:

Cya :slight_smile: