I'm trying to set the initial angle of my sprite to be 90 degrees. I don't want to call an action, is there a way of setting the angle parameter of a sprite as you do with the position?
You can use the zRotation property of SKNode which accept radiants
There's a useful extension for that
extension Int {
var degreesToRadians: Double { return Double(self) * M_PI / 180 }
var radiansToDegrees: Double { return Double(self) * 180 / M_PI }
}
sprite.zRotation = CGFloat(90.degreesToRadians)

The Euler rotation about the z axis (in radians).
The default value is 0.0, which indicates no rotation. A positive value indicates a counterclockwise rotation. When the coordinate system is rotated, it affects the node and its descendants. The rotation affects the node’s frame property, hit testing, rendering, and other similar characteristics.
The Yoshi's Island image comes form here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With