I have a physics body that needs the y scale to be 0.2. I have been using the rectangleOfSize property to define my physics body, but am not sure how to change the y scale of it. I had changed the y scale earlier in the code, and would like to know if there is an easier way to do this other than having to go into photoshop and create a new image. I will provide example code if anyone needs me to. Thanks!
2
Answers
Yes, there is an easier way! I recommend looking into
SKAction
.SKAction
contains the class methods:Unfortunately, scaling the physicsBody in Spritekit would cause collisions to be bugged, I would recommend that you create a new physicsBody and assign it to the node instead.
As to change the yScale of the node, you can simply call this function