Do not crash on empty path, closes #23701
This commit is contained in:
parent
d79c8d7655
commit
6cd4006fb3
1 changed files with 3 additions and 0 deletions
|
|
@ -170,6 +170,9 @@ void PathFollow2D::_update_transform() {
|
|||
return;
|
||||
|
||||
float path_length = c->get_baked_length();
|
||||
if (path_length == 0) {
|
||||
return;
|
||||
}
|
||||
float bounded_offset = offset;
|
||||
if (loop)
|
||||
bounded_offset = Math::fposmod(bounded_offset, path_length);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue