unityのコードレビューしてくれ。at TECH
unityのコードレビューしてくれ。 - 暇つぶし2ch1:デフォルトの名無しさん
23/03/16 19:49:01.61 2Ni9Md6U.net
unity初めて1日。初心者です助けてわからん↓のどこかが間違ってるらしい
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
private void FixedUpdate()
{
//Rigdboodyを取得
Rigidbody rigidbody = GetComponent<Rigidbody>();

//方向キーの入力
float x = Input.GetAxis("Horizontal"); //横軸
float z = Input.GetAxis("Vertical"); //縦軸

//ベクトルに変換
Vector3 vec = new Vector3(x.0.z);

//力を加える
rigidbody.AddForce(vec);
}
}


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