Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to make a Game Controller vibrate using Xcode?

I've been using Apple's GameController framework so far, but there's no possibility to make the controller vibrate. I'm searching for something similar to Unity's Handheld.Vibrate(), but the last hours of research make me believe there's no simple API.

Is it somehow possible to make a Game Controller paired to macOS/iOS vibrate using Xcode? (Perhaps through directly sending signals to the controller)

like image 974
Valentin Walter Avatar asked Jan 23 '20 16:01

Valentin Walter


3 Answers

Apple's response to my feature request via Feedback Assistant:

Thanks for your feedback! For now, this issue behaves as intended.

We love rumble in the Xbox Wireless Controller and Sony DualShock4 controllers, too - we think it would be great in games on iPhones, iPads, tvOS, and macOS, too.


Looks like this is finally possible! There’ll be a talk about this on Wednesday. I will update this answer as soon as it’s available.

like image 159
Valentin Walter Avatar answered Nov 03 '22 21:11

Valentin Walter


According to Apple's Game Controller Programming Guide, this is not a supported way of interacting with controllers.

Understanding the Controllers Supported by Apple

Apple has created specifications for distinct kinds of MFi game controllers.

Although specific controllers vary, many common characteristics must be implemented strictly according to the specification.

The extended control layout contains the following controls:

  • Four analog face buttons arranged in a diamond on the right side of the controller (labeled A, B, X, and Y)
  • An analog directional pad on the left side of the controller
  • Two analog thumbsticks on the left and right sides of the controller
  • Two analog shoulder buttons (labeled L1 and R1)
  • Two analog triggers (labeled L2 and R2)
  • A button to pause and resume gameplay

The Siri Remote has its own micro control layout.

  • An analog directional pad on the top of the remote
  • Two digital buttons (A,X)
  • One button to pause and resume gameplay

If you directly communicate with a given controller over Bluetooth or similar, you could directly issue controller-specific commands (such as vibrate). Obviously, this would be vastly more complex as you would essentially have to re-implement the GameController framework yourself, listening to commands in an event loop and responding to these in your app. Communication protocols to the controllers likely varies between different makes and models as well, adding even more complexity and cost to the development.

Your best bet is to submit a feature request directly to Apple, via Feedback Assistant.

like image 2
Bradley Mackey Avatar answered Nov 03 '22 20:11

Bradley Mackey


It's coming to iOS 14 to support haptic feedback from the third party controllers. https://developer.apple.com/videos/play/wwdc2020/10614/

like image 1
James Martin Avatar answered Nov 03 '22 19:11

James Martin