All Questions

Community

WhistaphX

Linear_velocity

So velocity and linear velocity had the same value? (We named before velocity: = Vector2.ZERO) Are the same thing just with different name or they are different values that refer the same thing? Sorry but it's a little bit confusing.

  • Nathan Lovato replied

    Yes, velocity is a short name for linear velocity in this case, a term from physics, a vector that represents direction and speed.

    We use the term linear_velocity in the function's arguments so it's not the same as our initial variable.

    In the function, we take the current velocity of the player, calculate a new one, and we return it

  • WhistaphX replied

    Perfect, thank you!