Lifting things in a physics enabled environment

Hi guys!

I’m currently working on a project, that requires the main Player controller to lift stuff, and fly around with it.
Everything is done using addForce and so forth, in order to create a flying player controller.

My problem is, that the current approach I have, is to check underneath the player controller (at all times) with rays, for objects that has the “canBeMoved” tag - spawn a button - and at the press of that button, I want to lift it up, and fly around with said object.

I just can’t find the right solution for making the “anchor” feel right.
Has anyone of you experienced this problem in one of your projects?

Best Regards -
Trixxr

No one?
I kinda thought it was something pretty straight forward - but I couldn’t find anyone else having the same problem, so I had really high hopes for you guys!

you’re going to have to expand on “feel right”…

You’ve described a system that works, so there isn’t anything concrete to “fix” here… hard to answer an opinion question as it’s individual.

So the feel right “goal” is this:

Have a system that allows the player to fly above an object (Not a part of the problem I’m trouble shooting)
if Object has a specific tag it spawns a button (Not a part of the problem I’m trouble shooting)
When I press the button - an anchor, hinge, joint, something spawns (or gets the current object as a target) - THIS is the problem I’m having.

I want the player to be able to pick something up - fly around with it. IF it hits something - it could potentially make my player lose speed - or break off the hinge.

I just don’t know how to translate it into code - the “Set this as an Anchor without stuff just flying around or feeling static”.

If you’ve ever played “Just Cause 2”, then you can use a grappling hook to hook stuff onto helicopters - I want THAT effect. http://www.youtube.com/watch?v=orkrnbWVYjI

If Helicopter flies over Jeep - Button spawns - THe two gets connected - Helicopter can go do whatever helicopter damn feels like!

Okay, thing is, what you are looking for is rope physics. It’s not an easy task, but it’s not that hard either. What you want to do is generate an arbitrary number of gameobjects (possibly having collider cylinders), and link them via hinge joints. You can set desired breaking forces on one or more of the joints. Essentially what this will do, is cause the hinge to “snap”, separating the joints when physics force differential between the two objects reaches X units of force.

Lastly, you want to create a dynamic mesh which will use the endpoints of these gameobjects as bones for dynamic animation. Optimally, you will want this to be a low-poly textured cylinder, but you can also make this a billboard.

Rather than setting a button when you CAN pick something up, it’d probably be more elegant to bind a button to your grappling hook, then run a trace for physics objects that the hook can attach to. If the hook strikes something it can grab, it will attach the bottom-most hinge to the grabbed object, then generate the subdivision gameobjects between point A and point B.

That’s all there is to it. Remember, your physics engine is going to add the forces between these two objects for you, all you have to do is make sure that your masses are set up sensibly and the relative unitary movement of your primary velocities and acceleration due to gravity is configured in a congruent manner.

There are a lot of different approaches for rope physics, though, but in the end they are all based on the same concept: A dynamic animated visual-only mesh subdivided to the desired level of decimation, either with or without physical bounding colliders, wrapped around an arbitrary physics activated points hinged together.

Make sense?