Code cannot go in a definition (such as for a panel or text object). With 400+ panels to handle in my 2D game, I also learned this too. Only initial values can be set without any math statements in it.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials