Xcode 9.1 (and 9.2) - Referenced sprites are not executing Actions added in Scene Editor

前端 未结 4 453
伪装坚强ぢ
伪装坚强ぢ 2020-12-31 15:19

I have come across some unexpected behaviour when using the SpriteKit Scene Editor, and wonder if anyone else is having the same issue.

I created a sprite in a scene

相关标签:
4条回答
  • 2020-12-31 15:32

    Hi,I had this same problem. Below is my solution:

    override func didMove(to view: SKView) {
        sleep(1)
    }
    

    However,this is not good way. I hope I can help you temporarily. If you slove this problem or find a better solution, please reply me, thank you.

    0 讨论(0)
  • 2020-12-31 15:48

    Sadly, this problem persists in Xcode10. If you are using custom classes, either directly or as the parent node, the easiest way to fix this is to add self.isPaused = false to the init?(coder aDecoder: NSCoder) method of your custom class.

    0 讨论(0)
  • 2020-12-31 15:51

    I asked a similar question just the other day: XCode 9: SKEditorReference doesn't allow animations?

    The only way I was able to get this to work was to put the isPaused on the exact sprite node I was trying to animate (within a ref node - I had created an entire sks scene/file and drag-dropped that into my main scene).

    I tried isPaused=false at the top level, main scene didMove to view to no effect, and then added isPaused=false to the main reference node, to no effect. It worked only when I added isPaused=false the actual sprite I was trying to animate. I removed isPaused=false from the the main & ref nodes, and as long as it was still on the sprite node (within the ref node) I was trying to animate: success.

    Bottom line seems to be that isPaused=false is required on any sprites within a reference node.

    0 讨论(0)
  • 2020-12-31 15:55

    I had this same problem and it was driving me crazy. I tried setting the .isPaused on the scene and on the individual sprites. Nothing worked except the insert breakpoint method. That is not a solution.

    What I discovered was if I set the is paused to true and false (which is the value I wanted) then it worked for all the sprites.

     override func didMove(to view: SKView) {
        self.isPaused = true
        self.isPaused = false
    }
    

    This is a pretty annoying bug in scene editor that should be fixed.

    0 讨论(0)
提交回复
热议问题