Using XINPUTDOTNET we can put controller shake into a Unity project.
To set the controller you want to shake use this code:
PlayerIndex playerIndexOne = PlayerIndex.One; // sets first controller
PlayerIndex playerIndexTwo = PlayerIndex.Two; // sets second controller
GamePad.SetVibration(playerIndexOne, .1f, .1f); // shakes first controller
GamePad.SetVibration(playerIndexTwo, .1f, .1f); // shakes second controller
Thanks for watching!
Sur cette page du site, vous pouvez voir la vidéo en ligne UNITY TUTORIAL Controller Vibration/Rumble/Shake EASY durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Simple Systems Studios 27 janvier 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 16,726 fois et il a aimé 276 téléspectateurs. Bon visionnage!