Applying Linear Velocity in current direction of travel

Hi, I would like to have my game object increase in speed (on it’s current trajectory) after certain score-milestones have been reached… I thought his would work, but it’s resulting in an unwanted change of direction

vx, vy = body:getLinearVelocity() body:setLinearVelocity( vx+10, vx+10 )

Any help appreciated

Mark

Are you wanting to change the direction in both the X and Y direction?  If vx and vy are negative, I would think you would subtract the change in velocity.

Rob

Do this instead

vx, vy = body:getLinearVelocity()
body:setLinearVelocity(vx * 1.5, vy * 1.5)

Are you wanting to change the direction in both the X and Y direction?  If vx and vy are negative, I would think you would subtract the change in velocity.

Rob

Do this instead

vx, vy = body:getLinearVelocity()
body:setLinearVelocity(vx * 1.5, vy * 1.5)