- Home /
Grabbing objects in a zero gravity enviroment?
Hello guys, I'm trying to understand how can I achieve the following game mechanic. The idea is simple, a zero gravity enviroment with some cubes floating arround, the player, who entered the zero gravity zone wil do so with a certain velocity (the player cannot control the movement while in mid flight). What I need is the player to get attached to the floating cube, this means that by effect of physics, both the cube and the player will continue moving towards the correct direction. The player, because of his speed and momentum, will cause the cube to also move.
So what i did is just to set the enviroment up, by changing the physics settings to 0 gravity and bounce threshold to 0 aswell. This is for the collision to be correct.
Once the player has touched and by extension, "grabed" the cube, then if he presses a key (lets say E) he will impulse himself leaving the cube behind. I think you understand the idea.
Unfortunatly I don't know how to achieve this. Can you help me please!? (I'm sorry about my english btw)
Your answer