前提・実現したいこと
前提
unityを初めて1か月ほどの初心者。。
ハンドルコントローラー : logicool driving forve GT
unity バージョン :2019.4.3f1
実現したいこと
unityで道路を作成してハンドルコントローラー使用して車を操作したい
発生している問題・エラーメッセージ
CS1022
CS0116
CS8124
CS1519
CS1513
CS1026
計23エラーでています。
試したこと
using
1using UnityEngine; 2using UnityStandardAssets.CrossPlatformInput; 3 4namespace UnityStandardAssets.Vehicles.Car 5{ 6 [RequireComponent(typeof(CarController))] 7 public class CarUserControl : MonoBehaviour 8 { 9 private CarController m_Car; // the car controller we want to use 10 11 12 private void Awake() 13 { 14 // get the car controller 15 m_Car = GetComponent<CarController>(); 16 } 17 18 19 private void FixedUpdate() 20 { 21 // pass the input to the car! 22 float h = CrossPlatformInputManager.GetAxis("Horizontal"); 23 float v = 0; 24 float a = CrossPlatformInputManager.GetAxis("accel"); 25 float b = CrossPlatformInputManager.GetAxis("braek"); 26 public float AccelPower; 27 public float BreakPower; 28 29 var NewA = -a * PulsPower; 30 var NewB = b / BreakPower; 31 32 if (b > 0) 33 { 34 v = NewB; 35 } 36 else if (a > 0) 37 { 38 v = NewA; 39} 40 41 42 43 44#if !MOBILE_INPUT 45float handbrake = CrossPlatformInputManager.GetAxis("Jump"); 46 m_Car.Move(h, v, v, handbrake); 47#else 48 m_Car.Move(h, v, v, 0f); 49#endif 50 } 51 } 52}
補足情報(FW/ツールのバージョンなど)
public floatをfloatに書き換えると23個のエラーメッセージが消えます。
しかし、unity上でエラーが発生します。
未割り当てのローカル変数「BraekPower」の使用
未割り当てのローカル変数「AccelPower」の使用
とでます。
解決できていませんが補足事項として。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/07/23 12:44
2020/07/27 00:22
2020/07/28 04:45
2020/07/28 05:16
2020/07/28 05:31
2020/07/28 09:27