Hi, I'm getting this error stating "Timer was not added to the SceneTree. Either add it or set autostart to true." A couple issues with this -- it's literally right there in the sceneTree, as a child of another node. Additionally, I've set autostart to true and I still get this error. This error doesn't seem to break the game at all but it's just a bit annoying and I don't know if it's something I'll actually have to deal with later, so any ideas on how to stop this error from outputting is much appreciated!
#Timer was not added to the sceneTree
13 messages · Page 1 of 1 (latest)
you can add this line above 261
assert($Trampoline/TrampTimer.is_inside_tree())
this should pause execution if thats not the case
then you can view the Remote scene tree to get a live picture of your nodes at this point during runtime
maybe you will find a clue to whats wrong
Thanks for your reply. I tried this out and it said "Assertion failed". When checking the remote tree, I once again saw the node right there, so I don't know where to go from there. I went to the physics_process function and had it print out ($Trampoline/trampTimer.is_in_scene()) and it's true on every frame. I'm not sure why this error is displaying, or if it even matters (like I said, it isn't crashing the game, but I get worried when seeing a red error"
Ok that's weird. Could be an engine bug, still unlikely but at least possible
to which node is that script assigned to?
the Node2D?
is that script used anywhere else?
Hi, thanks for responding. The script is only used once, and yes it's attached to a Node2D. I actually moved the code for the timer to the 'trampolineSprite' script (which is attached to a Sprite2D) and it had the same functionality (in that it worked) but it outputted the same error of "Timer was not added to the SceneTree"
Good to know, thank you for responding to my initial question anyhow! Much appreciated!
did you update the node path?
What do you mean exactly? Could you give an example/elaborate?
$Trampoline/tramptime