Added is_inside_tree() check in both Timer and Tween
Tween now throws error and doesnt even execute.
This commit is contained in:
@@ -107,6 +107,9 @@ bool Timer::has_autostart() const {
|
||||
}
|
||||
|
||||
void Timer::start(float p_time) {
|
||||
|
||||
ERR_FAIL_COND_MSG(!is_inside_tree(), "Timer was not added to the SceneTree!");
|
||||
|
||||
if (p_time > 0) {
|
||||
set_wait_time(p_time);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user