diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-09-03 18:35:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-03 18:35:20 +0200 |
commit | 750f8d4926edb14269d9f6a117c5a9fd4765373a (patch) | |
tree | c813e0fb3d62ae67be4d8a3b091b68fc00a59344 /scene/animation/tween.cpp | |
parent | 86c930998bc5620edb04df492117aa6f5e410a2e (diff) | |
parent | 5e337b31ebcf4509e1cf4cb64b02908ade59df05 (diff) |
Merge pull request #31844 from 2shady4u/TweenInSceneTree
Timer and Tween check if they are in SceneTree when starting
Diffstat (limited to 'scene/animation/tween.cpp')
-rw-r--r-- | scene/animation/tween.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 2609924f33..0f7d4466c8 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -783,10 +783,12 @@ float Tween::get_speed_scale() const { } bool Tween::start() { + + ERR_FAIL_COND_V_MSG(!is_inside_tree(), false, "Tween was not added to the SceneTree!"); + // Are there any pending updates? if (pending_update != 0) { // Start the tweens after deferring - call_deferred("start"); return true; } |