Tap into virtual and physical game controllers

RSS for tag

Discuss the WWDC21 session Tap into virtual and physical game controllers.

View Session

Posts under wwdc21-10081 tag

5 Posts
Sort by:
Post not yet marked as solved
1 Replies
591 Views
GCVirtualController isn't displaying when used with SKScene class. The Virtual controllers appear but then it seems that they are obscured by the SKScene itself!? The documentation says that calling connect() will display the virtual controllers but I seem to be missing how to add the controllers to the SKScene? class GameScene: SKScene { private var _virtualController: Any? @available(iOS 15.0, *) public var virtualController: GCVirtualController? { get { return self._virtualController as? GCVirtualController } set { self._virtualController = newValue } } override func didMove(to view: SKView) { let background = SKSpriteNode(imageNamed: ".jpg") background.zPosition = -1 addChild(background) let virtualConfig = GCVirtualController.Configuration() virtualConfig.elements = [GCInputLeftThumbstick, GCInputRightThumbstick, GCInputButtonA, GCInputButtonB] virtualController = GCVirtualController(configuration: virtualConfig) virtualController?.connect() } } I've also tried adding the virtual controllers in the UIViewController but this doesn't work either.
Posted Last updated
.
Post not yet marked as solved
0 Replies
347 Views
I'm trying to use GCVirtualController in an app and am running into an apparent bug when trying to use it in portrait mode. If I create "left side" and "right side" elements such as a left analog stick and right analog stick, things appear as expected when in landscape mode. When I switch to portrait mode only the right side elements appear. This doesn't appear to be a documented limitation and I'd like to be able to use the GCVirtualController in both orientations. Any advice? Is this just a bug or an intentional design limitation.
Posted
by theficus.
Last updated
.
Post not yet marked as solved
0 Replies
348 Views
GCVirtualController supports setting a UIBezierPath for configuring controller elements. This seems to work fine for things like A/B/X/Y buttons but it seems to be silently ignored when trying to set against the analog stick elements. This doesn't seem to be a documented limitation. Is this just a bug in GCVirtualController or an intentional limitation?
Posted
by theficus.
Last updated
.
Post not yet marked as solved
1 Replies
819 Views
Is there support for playing custom haptic files to the grips of Sony's DualSense Game Controller? The video mentions supporting the adaptive triggers on the DualSense. We are not finding a way to reference the haptic actuators in the grips. We'd like to play custom haptic files to them as well as audio to the speaker inside the DualSense. Searched the WWDC21 content as well as the documentation. Have not found the answer yet. Thank you!
Posted Last updated
.