Post not yet marked as solved
Post marked as unsolved with 1 replies, 902 views
I have Xcode 14.3.1
/////START of Code
import SpriteKit
import GameplayKit
class PlayerControlComponent : GKComponent, ControlInputDelegate {
var touchControlNode : TouchControlInputNode?
func setupControls (camera: SKCameraNode, scene: SKScene){
touchControlNode = TouchControlInputNode(frame: scene.frame)
touchControlNode?.inputDelegate = self
touchControlNode?.position = CGPoint.zero
camera.addChild(touchControlNode!)
}
func follow(command: String?) {
print("command:(String(describing: command))")
}
}
///////End of code
I have no error in project and the simulator shows launch screen then precedes to what I have on the game scene when I have no component in the component inspector of the the Sprite(player) when I add a component to the component inspector of the Sprite(player) that is when, after the launch screen, it is a grey screen.
The component is supposed to add the controls I created in the TouchContorolNode file and have the camera and controls so as the player moves the controls follow the Sprite(player).
Does anyone know why the screen is turning Grey after the launch screen with the comment attached to the Sprite(player)?