Phizix Object- Dragging bodies?
Is it possible to click on a body and drag it somewhere? I know how to do it with the last body ID, but I want to move whatever. Also, keeping the speed and acceleration of the mouse.
I'm trying to build something like Star wars force unleashed, but having nothing to do with star wars.
Thanks
Re: Phizix Object- Dragging bodies?
uhm, set the position of the body to the mouse X and Y?
Re: Phizix Object- Dragging bodies?
Physical bodies should only be moved by modifying their velocities, unless it is for a teleporter. Directly setting the position will ignore collision detection and some other vital things.
Re: Phizix Object- Dragging bodies?
Then do this
x velocity = xbody + ((xbody-xmouse)*0.5)
and same for y velocity except use y instead of x.
Should work.
Re: Phizix Object- Dragging bodies?
How am I supposed to know what the BodyID of the active is that I'm "picking" up?
Other than that, from what mechabowser said, everything else seems pretty understandable.
Re: Phizix Object- Dragging bodies?
Have you attached actives to the objects? In that case you can use the expression "Get Body ID from Active" to retrieve it's body ID.
Re: Phizix Object- Dragging bodies?
I have a box attached to it. The box can be multiplied. But I'll try that. The group for them is Group.1.
I'm getting syntax errors from that expression.
-------------
I think I fixed the syntax errors, but it isnt working.
ActiveBodyID( "Phizix - Chipmunk Engine", Fixed( "Crate" ))+ActiveBodyID( "Phizix - Chipmunk Engine", Fixed( "Crate" )-XMouse)*0.5
That was a valid expression, but it didn't work.
Re: Phizix Object- Dragging bodies?
I have another question about the phizix too.
Is it possible to have more than one ragdoll at once? The joints seem to only work on one of them.
I mean with like a copy and pasted ragdoll, he falls apart in runtime.
Re: Phizix Object- Dragging bodies?
ActiveBodyID( "Phizix - Chipmunk Engine", Fixed( "Crate" )) is the body ID...
Use:
Set X Velocity of Body ActiveBodyID( "Phizix - Chipmunk Engine", Fixed( "Crate" )) to (Xmouse - X("Crate")) * 25
Fine-tune the force by changing the 25 part.
The ragdoll issue is most likely because Phizix can only create one at a time. Try looping through all ragdolls and create the joints one ragdoll at a time.