Questions tagged [skaction]

Questions about programming SKAction objects in Apple's SpriteKit graphics rendering and animation framework.

Use this tag for questions about programming SKAction objects in Apple's graphics rendering and animation framework.

An SKAction changes a node property over time. It can also run custom blocks and it can be run on individual particles of an SKEmitterNode. Multiple actions can be run in parallel or sequence.

Actions are evaluated after the SKScene's update method. The scene receives the didEvaluateActions message when actions have been evaluated for the current frame.

Note: actions override physics behavior, for example a node with physicsBody that runs a SKMove action will not stop at collisions.

Click Here for Apple Docs.

667 questions
6
votes
1 answer

SKSpriteNode will not fadeInWithDuration using SKAction in sequence Sprite Kit

Im running 3 SKActions in a sequence, the 1st two run just fine but the fadeInWithDuration does not fade in the node, the node just gets added right away when the view loads. Do I have to set the the initial alpha channel for the node to 0? Can…
Stefan
  • 61
  • 1
  • 4
6
votes
1 answer

Does the SKAction sequence actually wait until the action ends?

I have the following code: -(void)aggravatedSeek:(SKSpriteNode *)target{ _isAggravated = YES; SKAction *action = [SKAction runBlock:^{ double randTime = 0.2; NSLog(@"%f", randTime); [self moveToSpriteNode:target…
EvilAegis
  • 733
  • 1
  • 9
  • 18
5
votes
0 answers

Creating an SKAction extension for SKAudioNode

I have decided to break off my very painful relationship with SKAction.playSoundFileNamed and move on to using SKAudioNodes in our project -- the breaking point was their being totally broken by interruptions without any consistency. We are trying…
5
votes
3 answers

SKAction only runs after sleep or while running debugger

Using SpriteKit I'm trying to make a pause menu that animates (moves) off the screen when the player resumes the game. I create an SKAction and run it within touches began like so: let duration = TimeInterval(0.5) let moveAction = SKAction.move(to:…
Cameron Porter
  • 801
  • 6
  • 15
5
votes
1 answer

How to loop a dynamically delayed sequence of SKActions

I need to run an unknown amount (from an Array of Dictionaries) of SKAction sequences that are dynamically created and offset in a loop using a delay that increases as I go through the loop. printed output of the loop should appear in the following…
Ron Myschuk
  • 6,011
  • 2
  • 20
  • 32
5
votes
1 answer

I really don't seem to get the wait SKAction for a range

Sorry if this sounds too primitive. I really don't seem to get how the wait SKAction works for a range. I've seen a few posts, but I they don't clearly explain (to my understanding) how to calculate my range. For example I saw the ranges…
IronThrone
  • 242
  • 1
  • 10
5
votes
0 answers

Timer bar using scale SKAction, horrid SpriteKit rendering performance

I'm doing, what I think, is a very simple timer bar, with nothing else on the screen. Yet this can't maintain 60fps on an iPad Pro... am I doing something obviously heavy and wrong? let previewTime: TimeInterval = 3.0 func timerBar(){ let tbW:…
Confused
  • 6,048
  • 6
  • 34
  • 75
5
votes
2 answers

How to get SKAction(name:) to work reliably?

I've been working through the DemoBots example and having a lot of trouble getting it to work on all devices. https://developer.apple.com/library/prerelease/ios/samplecode/DemoBots/Introduction/Intro.html The current problem I'm having is that on an…
Sez
  • 1,275
  • 11
  • 26
5
votes
1 answer

Run SKActions sequence with different nodes

I know that I can create an SKAction.sequence which will run the actions of one node one by one. But how can I do that if I want to do a sequence with different nodes. I'd like to do something like that: Run action from node A wait 2 seconds Run…
Christian
  • 22,585
  • 9
  • 80
  • 106
5
votes
1 answer

Stop repeatActionForever in Sprite Kit

In my game, I am using SKAction repeatActionForever: method to periodically call some method with performSelector: . As I seen, there is no way to stop this. I tried to stop via removeActionForKey: or removeAllActions - no results. I don't want to…
Igor Prusyazhnyuk
  • 133
  • 2
  • 14
  • 29
5
votes
2 answers

Playing Motor Sound Effects for iOS SpriteKit Game... AVAudioPlayer vs SKAction vs?

I am developing a driving game using SpriteKit and am having trouble with engine sound effects. I want to have two different engine sounds. One for when the throttle button is being pressed and one for when the throttle button is not being…
ninefifteen
  • 931
  • 1
  • 10
  • 16
5
votes
1 answer

add SKAction to Sprite queue run one after another

I listen to touch and add SKAction to a sprite. If existing actions are not complete yet, I want the action to be added to a queue so it will execute one after another. Any experienced similar design? I did using Array and Block. If there is any…
Elliot Yap
  • 1,076
  • 1
  • 12
  • 20
5
votes
1 answer

Spritekit stopping sound

I'm currently developing a game using Apple's SpriteKit library but I'm unable to stop a sound after is has began playing. I have tried using the listed methods from the documentation in order to stop the Skaction from running but nothing seems to…
romsearcher
  • 340
  • 5
  • 19
5
votes
1 answer

SKAction scale physicsBody

I don't really know where to start. I have an image of a circle stored in an SKSpriteNode and a physicsBody that mirrors the size when it is created. I am using an SKAction to scale down the size of the image though, and the physicsBody remains the…
Max Hudson
  • 9,961
  • 14
  • 57
  • 107
4
votes
1 answer

SpriteKit increasing speed of move action

I have a simple game that two lines moving from top to bottom of the screen. There is a fixed space between those two lines and a ball has to pass through in that space otherwise game is over. I have no problem with the basics of the game, I can…
1 2
3
44 45