I want to use two simple SKActions
. I do know how this should work (and had worked many times before), but in my current project, I have some bugs, which are all caused by SKActions
not executing properly. Here is one of them.
I call this function every time a player loses the game:
func showTapToPlayLogo() {
let scaleOut = SKAction.scale(to: 1.1, duration: 1.0)
let scaleIn = SKAction.scale(to: 0.9, duration: 1.0)
let popAction = SKAction.sequence([scaleOut, scaleIn])
tapToPlayLogoSprite.isHidden = false
tapToPlayLogoSprite.run(popAction)
gameViewController.gameState = .tapToPlay
}
The function is called, but it seems the compiler does not understand what my instructions are. I am using Xcode 8
and Swift 3
, so I can use debug features like printing descriptions of objects etc. By printing descriptions of those two actions I get a message:
Printing description of scaleOut:
(SKAction) scaleOut = < variable not > available
I am doing something wrong without realizing it? I do have SpriteKit
imported.
EDIT:
This post has been identified as a possible duplicate of this post: lldb error: variable not available.
It seems to me that the problem mentioned in the linked post is not yet solved. Some other users wrote comments about having the same problem, which was not solved by checking if in Debug mode and turning optimization off (as others have suggested). I as well am in Debug mode and have optimization turned off.
My project is very small and the code causing problems is simple and straightforward. Even if compiler is optimizing it, I can hardly believe it would cause the showed code snippet to not execute properly (without being a bug). That's why I do not think this post is a duplicate.