I've used CGPath to create a race track by stroking the path and offsets of it to draw the road and lines. My hope was that I could use this CGPath in SpriteKit so that I could make a car sprite follow the track. I can get a sprite to follow the entire path from start to finish using SKAction.followPath (screenshot added at bottom of post.)
However, my issue is I sometimes want a car sprite to move from the start to the half-way point (or 25% or some fraction of the path.)
I don't see a way of doing with with an SKAction so I was looking into a way of taking a CGPath and splitting it to whatever fraction of the path I needed but I've yet to find anything that seems to do that. I'm reasonably hopeful it can be done since in a CAShapeLayer you can set strokeStart and strokeEnd to specify where you want the path stroked from percent start to percent end so it looks like something like this has already been implemented.
Is there any way of either getting SpriteKit to set the start and end point of followPath or modifying a CGPath so that it returns a subpath?