I want to set the limits of linear velocities of X and Y separately, heres what i have so far;
if linear_velocity.length() > max_speed:
linear_velocity = linear_velocity.normalized() * max_speed
else:
apply_central_impulse(Vector2(cos(angle), sin(angle)) * speed_acceleration)
gravity_scale = lerp(gravity_scale, 0, 0.1)
else:
gravity_scale = min(gravity_scale + gravity_acceleration, max_gravity)
this code sets both X and Y linear velocity limits to the max speed, being 300, but i want to set the limit of how fast X can go to 450, and how fast Y can go to 600 ONLY when it falls down, how can i achieve this?
I thought of getting the linear velocities X speed by linear_velocity.x
but that hasnt worked, and im unsure even if it did i could change the X limit to something else