Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Marakesch on March 26, 2016, 04:37:29 AM

Title: Limit velocity of the ball[SOLVED]
Post by: Marakesch on March 26, 2016, 04:37:29 AM
Good day everyone,
I have a ball, which one have acceleration by add force/impulse, when it touch platform. Problem is how to limit its velocity in any direction, when it reach some value. Thanks in advance
Title: Re: Limit velocity of the ball
Post by: centaurianmudpig on March 26, 2016, 06:19:05 AM
I think you should be able to do this by:
GetVelocity then clamp via Vector3ClampMagnitude and the SetVelocity.
Title: Re: Limit velocity of the ball
Post by: jeanfabre on March 28, 2016, 03:03:35 AM
Hi,

 yes exactly.

I am currently porting the asteroid Unity network sample, and the ship has velocity clamping, and I use this technic, however just slightly different in the following sense:

 for effective physics control, actions should perform on "FixedUpdate", not a regular Updates, and so vector3ClampMagnitude isn't featuring the option to use FixedUpdate.

 so I use Vector3ClampMagnitudeAdvanced from the Ecosystem (http://j.mp/PlayMakerEcosystem) which allows for clamping during FixedUpdate which results in a better more reliable system.

Bye,

 Jean

Title: Re: Limit velocity of the ball
Post by: Marakesch on March 28, 2016, 01:07:05 PM
Thanks for your replys, i will try do it. Before found solution by code, thanks anyway for your answers.