【3Dゲームエンジン】Unity質問スレッド21at GAMEDEV
【3Dゲームエンジン】Unity質問スレッド21 - 暇つぶし2ch919:名前は開発中のものです。
16/01/07 18:57:52.38 lawdn1GB.net
>>893
Unityよく分からんが多分これでいける

if (Input.GetKeyDown (KeyCode.X) )
{
GameObject clone = Instantiate (bullet2, transform.position, Quaternion.identity) as GameObject; //弾の生成
  clone.GetComponent<Rigidbody2D> ().velocity = new Vector2 (0, 15);       //弾をy軸15へ飛ばす
}
else if (Input.GetKeyDown (KeyCode.Z) )
{
GameObject clone = Instantiate (bullet, transform.position, Quaternion.identity) as GameObject; //弾の生成
  clone.GetComponent<Rigidbody2D> ().velocity = new Vector2 (0, 15);       //弾をy軸15へ飛ばす
}


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch