Vuforia を使用して Unity に取り組んでいます。
画像ターゲットにないオブジェクトを移動するためにキーボードの上/下矢印のように機能する必要がある仮想ボタンがあるので、基本を探しています。
私のクラスは次のように始まります:
public void OnButtonPressed(VirtualButtonAbstractBehaviour vb){
...
}
アップボタンのように動作させるには、これに何を入れる必要がありますか?
これらの仮想ボタンがなければ、スクリプトは次のようにオブジェクトを移動します。
void FixedUpdate(){
float moveHortizonal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHortizonal, 0, moveVertical);
rigidbody.AddForce (movement * speed);
}