Merge pull request #61601 from Haydoggo/path-follow-fix-3.x

This commit is contained in:
Rémi Verschelde 2022-07-18 09:36:22 +02:00 committed by GitHub
commit 33b5709d53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -312,6 +312,7 @@ void PathFollow2D::_bind_methods() {
}
void PathFollow2D::set_offset(float p_offset) {
ERR_FAIL_COND(!isfinite(p_offset));
offset = p_offset;
if (path) {
if (path->get_curve().is_valid()) {

View file

@ -320,6 +320,7 @@ void PathFollow::_bind_methods() {
}
void PathFollow::set_offset(float p_offset) {
ERR_FAIL_COND(!isfinite(p_offset));
delta_offset = p_offset - offset;
offset = p_offset;