Error: the name velocity does not exist in the current context

Please use code tags in the future so that your code is readable: Using code tags properly

Additionally, copy and paste the complete error message (do not try to summarize the error message yourself) as it includes the line the error was on.

Vector2 movement = new Vector2(mx * movementSpeed, rb,velocity.y);

You have accidentally placed a comma instead of a period between “rb” and “velocity”. It should be:

Vector2 movement = new Vector2(mx * movementSpeed, rb.velocity.y);

Remember, if you get a compile error while following a tutorial, go to the line with the error and pay extremely close attention to every letter and symbol used in the tutorial. A , instead of a . or a : instead of a ; can be the difference between a perfectly functional script and a project that won’t compile at all.