I’m trying to use the function in Chapter 5, p. 127. But it results in an error:
func moveCamera() { let backgroundVelocity = CGPoint(x: cameraMovePointsPerSec, y: 0) let amountToMove = backgroundVelocity * CGFloat(dt) cameraNode.position += amountToMove }
the error message:
Cannot convert value of type ‘CGPoint’ to expected argument type ‘CGFloat’
I am not able to resolve it. How can it be fixed?