You could use an SKEmitterNode and change the settings so hit looks like a trail.
To make a new emitter node, choose File -> New and search "SpriteKit Particle File".
Name it Trail
Here are the settings I would set:
Texture: spark (this is one of apple's defaults, but you can use your own)
Emitter: birthrate: 20, maximum: 0
Lifetime: start: 8, range: 0
Position: All of these fields set to 0
Alpha: 0.6, range: 0, speed: -0.06
Scale: 1, range: 0, speed: 0
Rotation: All these fields set to 0
Color Blend: factor: 1, range: 0, speed: 0
To use it in code:
let emitterNode = SKEmitterNode(fileNamed: "Trail") // or whatever you named your file
Add it to the node you want to have a trail:
yourNode.addChild(emitterNode)
Hope this helps!
Post
Replies
Boosts
Views
Activity
I would definitely check out the App Development With Swift books by apple on Apple Books.