LoginSignup
5
3

More than 3 years have passed since last update.

【Unity】XBOXコントローラの左右トリガー入力を別々に取得する

Last updated at Posted at 2019-04-24

結論

Windowsなら、9th-axisと10th-axisを使えば左右別々に取得できます。
Androidだと14th-axisと15th-axisです。
image.png

概要

  • Unityでゲームパッド(XBOX)を使うとき、はこねさんの記事にお世話になりました。記事内でも述べられていますが、左右のトリガー入力はまとめて一つのfloat型で3rd-axisから取得しているので、左右のトリガーのそれぞれの押し具合が分からなくなります。

  • Windowsでは、3rd-axisで左右混合の入力を取得できますが、9th-axisと10th-axisを使えば左右別々に取得することができます。

  • Androidビルドでは3rd-axisは使えないですが、14th-axisと15th-axisで左右トリガーの入力が取れます。

検証環境

  • Windows10 64bit + XBOX 360 コントローラ(有線)
  • Oculus Go + XBOX ONE コントローラ(無線)
  • Unity2017.4.24f1

参考記事

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3