Post

Replies

Boosts

Views

Activity

Reply to How to use GCVirtualController directly with SKScene?
covaticMyth, I hope you've already found your answer but I wanted to post the code that worked for me so anyone one else might come across it. Also, thank you for posting your question, it helped me. In the Game Scene, I declared it similar to you: private var _virtualController: Any? @available(iOS 15.0, *)         public var virtualController: GCVirtualController? {             get {return self._virtualController as? GCVirtualController}             set {self._virtualController = newValue}         } In the Game Scene I also created the following function, which I called in the didMove function: func configVirtualController(){         if #available(iOS 15.0, *) {             let virtualConfig = GCVirtualController.Configuration()             virtualConfig.elements = [GCInputLeftThumbstick, GCInputButtonA, GCInputButtonB]             virtualController = GCVirtualController(configuration: virtualConfig)             virtualController?.connect()         } else {             // Fallback on earlier versions         }
Jan ’22