PlayMaker Help & Tips > PlayMaker Help

Slowing down a rigid body...

(1/1)

bartleycollin:
I need some advice with this... I've been using playmaker for over a year now, but I haven't worked with Physics much at all.. Here's what I need help with

I'm creating a simple space game and I'm currently working on the Ship controller. I've been using the "Add force" action to move the object, and that works quite well. It give it the "Floating in the air" effect. My problem is, I'm not sure how I would go about slowing the force down. Right now if I stop pressing the left arrow key, the ship just glides for a while before gradually stopping.

tl;dr - How do I slow down a force?

jeanfabre:
Hi,

 to slow down, apply a force opposite to the direction of your gameobject, and apply a multiplier based on the current speed so that it brakes more when speeding and as it brakes the brake force is less and less ( else it would go backward at some point).

Otherwise, increase the drag of the RigidBody, that's very effective as well and simpler to implement.

Bye,

 Jean

bartleycollin:
Thanks Jean! I got it to work better by setting the drag property to 1 when it was on my Idle state.

1 more quick question. I'm happy with my controller, but the speed is a little bit too "icy" if you will.

Basically when I hit the left arrow, it takes to long for the ship to gain speed. It slowly builds up speed. I need it to be faster. Any tips?

jeanfabre:
Hi,

 I would set the drag to 0 when your user is controlling the ship, and then set it to 1 when the user not controlling it ( no user inputs)

bye,

 Jean

Navigation

[0] Message Index

Go to full version