-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flight speed #6076
base: minor-next
Are you sure you want to change the base?
Add flight speed #6076
Conversation
My issue with this is the same as the past PRs on the subject. There's no explanation or documentation of what the values mean, or why it's 0.05 by default. What's the unit? Blocks per seconds? Blocks per tick? There's also going to be questions like why doesn't The name |
I also think the name isn't quite right. It will indeed be confusing. However, I don't think that the unity problem should hinder the merge of adding APIs. It's up to the developers to find out what they're modifying, and a warning could be added in the docs about this. That the unit is not determined and that the value should be handled with care? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me
Negative values make the player fly backwards, and this can be used in some game modes
Apparently with tests I have done I've been testing if other attributes like movementSpeed or walkSpeed can modify the flight speed, but that doesn't happen. Alosi it seems that walkSpeed only modifies the player's fov. When a player sprints while flying his speed is duplicated, with the default value the player's flight speed will be around |
@Sergittos @ShockedPlot7560 I think this PR is fine once documentation on the value of the FlySpeed is present. As in, an explanation as to how the values are calculated. |
if this correct can't we use blocks it can travel per tick as a parameter in the function instead of magic numbers |
If @IvanCraft623 researchs is correct, we can document the method with this and it will be ready to merge for me. |
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation is enough for me.
Introduction
This pull request makes it possible for developers to modify a player's flight speed.
Relevant issues
Closes #5155
Changes
API changes
Added the following methods in
Player
:Player->setFlightSpeed()
: Sets the player's speed when flying.Player->getFlightSpeed()
: Returns the player's speed when flying.Added the following constant in
Player
:Player::DEFAULT_FLIGHT_SPEED
Tests
https://streamable.com/vctb3y