I'm fairly new to swift and I'm creating a grapple hook mechanic and I'm trying to draw a line between the hook and the player when the screen is tapped, but I keep coming up with Missing Argument for parameters in call
which I don't know what to make of it. I've researched and tried multiple things, I know there is multiple question about this error, but I can't relate it to my problem. I think the fact that I am new has a lot to do with it.
let ropePath = CGMutablePath()
CGPathMoveToPoint(ropePath, player.position.x, player.position.y)
CGPathAddLineToPoint(ropePath, ropeTarget.position.x, ropeTarget.position.y)
rope.path = ropePath
rope.strokeColor = UIColor.red
rope.lineWidth = 8
The errors are on both the CGPaths
, I can tell you everything I try creates a different error that is:
Cannot convert CGFloat to expected argument type UnsafePointer CGAffineTransform
So I guess my question is how do I convert the CGFloat
to the correct argument?
Also if this is a really simple fix could you possibly explain or link some documentation that will help me better understand? Thank you!