Skip to content
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

Tween.stop documentation has ambiguous description of effects #10196

Open
Meorge opened this issue Nov 3, 2024 · 0 comments · May be fixed by godotengine/godot#98787
Open

Tween.stop documentation has ambiguous description of effects #10196

Meorge opened this issue Nov 3, 2024 · 0 comments · May be fixed by godotengine/godot#98787
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository bug

Comments

@Meorge
Copy link

Meorge commented Nov 3, 2024

Your Godot version: 4.3, 4.4

Issue description:

The documentation for Tween.stop reads:

Stops the tweening and resets the Tween to its initial state.

The phrase "initial state" implies that the property being tweened would snap back to whatever it was when the Tween began. This is not the case; when a stopped tween is played with Tween.play, it begins interpolating from where the tween stopped towards the final value again.

The code for Tween.stop is:

void Tween::stop() {
	_stop_internal(true);
}

void Tween::_stop_internal(bool p_reset) {
	running = false;
	if (p_reset) {
		started = false;
		dead = false;
		total_time = 0;
	}
}

So, what stop does is:

  • Set running to false (since it is no longer being evaluated currently)
  • Set started to false (as if it hadn't executed at all yet)
  • Set dead to false (so if it has been killed or finished running, it will be usable again)
  • Set total_time to 0 (so that when run, it will take the full amount of time to finish again)

Notably, it does not reset the value of the property it is interpolating.

I think the documentation should be updated to clarify what is considered the tween's "initial state" in this context (specifically the fact that an interpolated property is not reset to the initial value).

URL to the documentation page:

https://docs.godotengine.org/en/stable/classes/class_tween.html#class-tween-method-stop

@Meorge Meorge added the bug label Nov 3, 2024
@Piralein Piralein added the area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository label Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants