I want to create a wall that increases size. But when I increase the size the Physics body dosn´t follow (It keeps the same size). So I have an idea that a SKAction that repeats forever perform a selector that resizes my physics body depending of the size of the object.
So I wanted to make a code like:
-(void) sizeChange:(SKSpriteNode *)sprite{
sprite.physicsbody = [SKPhysicsBody bodyWithRectangleOfSize: sprite.size];
}
Now I want to run a SKAction that perform selector with this. So I wrote this:
SKAction *perform = [SKAction performSelector:@selector(sizeChange:) withObject: sprite onTarget: self];
[self runAction:[SKAction repeatActionForever:perform]];
The SKAction down´t work with "WithObject". How do I add a parameter to a performSelector SKAction?
Thank you!
EDIT:
Basically I want the SKAction equivalence of:
[self performSelector:@selector(sizeChange:) withObject:sprite];
Or a way to repeat the code before forever. Thank You!