2021.10.08 unity 3 dゲームの作成
1347 ワード
-メタル(シェーダ+テクスチャ)
構成メニュー(UI構造図)
-プレーヤーの操作
keycode
gameObject-自分を指す
SetActive()
private
GetComponent<>()
GetAxis
-おめでとう.
Horizontal
Vertical
ベクトル3-物体の式
transform
Destroy()
Random.Range()
findObjectOftype<>
Time
キャメルボックス
other.(オブジェクトを表示可能)またはゲームオブジェクト
-update
-入力検出
-input Manager
構成メニュー(UI構造図)
-プレーヤーの操作
public class PlayerController : MonoBehaviour
{
public Rigidbody playerRigdbody;
public float speed = 8f;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKey(KeyCode.UpArrow) == true)
{
playerRigdbody.AddForce(0F,0F,speed);
}
if (Input.GetKey(KeyCode.DownArrow) == true)
{
playerRigdbody.AddForce(0F, 0F, -speed);
}
if (Input.GetKey(KeyCode.LeftArrow) == true)
{
playerRigdbody.AddForce(-speed, 0F, 0F);
}
if (Input.GetKey(KeyCode.RightArrow) == true)
{
playerRigdbody.AddForce(speed, 0F, 0F);
}
}
}
input.getkey()keycode
gameObject-自分を指す
SetActive()
private
GetComponent<>()
GetAxis
-おめでとう.
Horizontal
Vertical
ベクトル3-物体の式
Vector3 newVelocity = new Vector3(xspeed, 0f, zspeed);
playerRigdbody.velocity = newVelocity;
イベントトリガ(条件結果または競合結果)transform
Destroy()
Random.Range()
findObjectOftype<>
Time
キャメルボックス
other.(オブジェクトを表示可能)またはゲームオブジェクト
-update
-入力検出
-input Manager
Reference
この問題について(2021.10.08 unity 3 dゲームの作成), 我々は、より多くの情報をここで見つけました https://velog.io/@shallet/2021.10.08-unity-3d게임-만들기テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol