【ゲームエンジン】Unity初心者質問スレBuild1at GAMEDEV
【ゲームエンジン】Unity初心者質問スレBuild1 - 暇つぶし2ch41:名前は開発中のものです。
18/06/24 08:56:29.31 k+l2FErP.net
>>38
ぶつけかたというのはスクリプトでいいでしょうか
public float speed = 3f;
float moveX = 0f;
float moveY = 0f;
Rigidbody2D rb;
void Start(){
rb = GetComponent<Rigidbody2D> ();
}
void FixedUpdate () {
moveX = Input.GetAxis ("Horizontal") * speed;
moveY = Input.GetAxis ("Vertical") * speed;
rb.velocity = new Vector2(moveX, moveY);
}


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