how stop box in ramp

vrs1362
Posts: 2
Joined: Thu Mar 19, 2009 11:31 pm

how stop box in ramp

Post by vrs1362 »

Hi, I am working on a rts game and I have one question.
I have terrain with ramps (mountains) and I move a tank with the mouse around the ground
I appliead linear velocity to the tank and this move up the ramp.
However, when the tank arrives to the destination, linear velocity = 0,0,0
and the tank begins to descend the ramp.

How can I stop the tank in that position?

thanks. bye

NOTE: tank is btBoxShape
pico
Posts: 229
Joined: Sun Sep 30, 2007 7:58 am

Re: how stop box in ramp

Post by pico »

Hi,

have you tried to set a higher friction?
vrs1362
Posts: 2
Joined: Thu Mar 19, 2009 11:31 pm

Re: how stop box in ramp

Post by vrs1362 »

hi
Yes, I set higher friction and the tank doesn't move up the ramp ...
pico
Posts: 229
Joined: Sun Sep 30, 2007 7:58 am

Re: how stop box in ramp

Post by pico »

Change the friction dynamically. Set it low when moving. Set it high when resting. You may want to use the custom material callback for such things.