Chapter 5 - moveCamera function error

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?

The line backgroundVelocity * CGFloat(dt) is multiplying a CGPoint by a CGFloat. For this to work, there is an operator overload defined in MyUtils.swift. That file should be there in the starter project for Chapter 5.

Did you perhaps use the project from an earlier chapter and miss the part where MyUtils.swift is added (in Chapter 2)?