FPS Controls for mobile devices Unity3D source code

製品情報

¥18,475
cart 買い物カゴに追加 favorites お気に入りに追加

プログラミング言語

ユーザーガイド 画像 プレビュー 動画

inspectedPieceX検証済み

デベロッパー

avatar
Unity Games
×

価格交渉

コードサンプルのリクエスト ダイレクトメッセージ

2020年08月28日

公開チャット

製品詳細

You can test it here (WebGL): 

https://e-ugovor.rs/FPS_Controls/

Or download test apk and test it on your android device: 

https://www.dropbox.com/s/nuj1bwive9n324b/FPS%20Controls.apk?dl=0


This asset will provide you with FPS controls for mobile devices that is very easy to setup and use.

How to use it?

• Drag and drop “Joystick.prefab“ from “Prefab” folder into your scene.
• Add EventSystem to your project hierarchy (Right click inside project hierarchy – UI – EventSystem)
• Use “JoystickLeft.positionX” static variable inside your scripts to get left joysticks X axis value, use “JoystickLeft.positionY” to get Y axis value (you will get value from -1 to 1 for x and also from -1 to 1 for y axis).

*Example
Vector3 moveX = JoystickLeft.positionX * speed * transform.right;
Vector3 moveY = JoystickLeft.positionY * speed * transform.forward;
rigidbody.MovePosition(transform.position + moveX * Time.fixedDeltaTime + moveY * Time.fixedDeltaTime);

In case that your character doesn’t have rigidbody you can use this:

transform.position = transform.position + moveX * Time.fixedDeltaTime + moveY * Time.fixedDeltaTime;

- For rotation use JoystickRight.rotX and JoystickRight.rotY.

* Example

void Update() {
transform.rotation = Quaternion.Euler(JoystickRight.rotY, JoystickRight.rotX, 0);
}

• To detect if shot button is pressed you can use JoystickRight.shot static variable. It will return true when shot button is pressed and false when it is released.
• To detect if jump button is pressed use JoystickRight.jump. It will return true whan jump button is pressed and false when it is released.

File Tree

  • 📁 FPS Controls for mobile devices Unity3D source code

価格情報

価格の統計

最高価格
¥18,530
平均価格
¥18,368
最低価格
¥18,096
AI価格予測
¥3,460

インサイト

限定プレビュー


実際の製品には、すべてのファイルと完全なコードが含まれています。

依存パッケージ

依存パッケージを表示する

ランダムサンプルファイル

プロジェクトファイルの統計

階層

サンプルファイルを選択してください
X
user-symbol

Stay in touch

ビジネスおよび開発者向けの実用的な最新情報をご希望ですか?

ソースコードプロジェクトに対するPieceXコミュニティのニーズについてご提供します。

PieceXの最新の無料コミュニティコードプロジェクトをいち早くお知らせします。