Player controller jednoty c#

Příklady kódu

3
0

jednoduchý přehrávač řadič jednoty

//USES A RIGIDBODY (Unity)//

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
   public float speed;
   
   private Rigidbody rb;
   
   
   
   //Start is called before the first frame update//
   void Start()
   {
       rb = GetComponent<Rigidbody>();
   }
   
   //Update is called once per frame
   void FixedUpdate()
   {
      float moveLR = Input.GetAxis("Horizontal");
      float moveFB = Input.GetAxis("Vertical");
      
      rb.AddForce (new Vector3(speed * moveLR, 0, speed * moveFB));
   }
}

V jiných jazycích

Tato stránka je v jiných jazycích

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................