Using System. Collections;
Using System. Collections. Generic;
Using unityengine;
Public class playermovement: Monobehaviour.
{
Rigidbody2D RGB;
Vector3 velocity;
Float speedamount = 5F;
// Start is called before the first frame Update.
Void Start()
{
RGB = GetComponent<Rigidbody2D>();
}
// Update is called once per frame.
Void Update()
{
Velocity = New Vector3(ınput. Getaxis("horizontal"), of);
Transform. Position += velocity * speedamount * time. Deltatime;
}
}
Hatam olan kısmı of diye göstermekte Unity'e yeni başladım ne yapmalıyım?
Bu script dosyasının adını PlayerMovement olarak değiştir.
Edit: Kütüphanenin adı da yanlışmış onu düzelttim.
C#:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : Monobehaviour
{
Rigidbody2D RGB;
Vector2 velocity;
float speedamount = 5f;
// Start is called before the first frame Update.
void Start()
{
RGB = GetComponent<Rigidbody2D>();
}
// Update is called once per frame.
void Update()
{
velocity = new Vector2(Input.Getaxis("Horizontal"), 0f);
velocity = velocity * (speedamount * Time.deltaTime);
RGB.velocity = velocity;
}
}
Using System. Collections;
Using System. Collections. Generic;
Using unityengine;
Public class playermovement: Monobehaviour.
{
Rigidbody2D RGB;
Vector3 velocity;
Float speedamount = 5F;
// Start is called before the first frame Update.
Void Start()
{
RGB = GetComponent<Rigidbody2D>();
}
// Update is called once per frame.
Void Update()
{
Velocity = New Vector3(ınput. Getaxis("horizontal"), of);
Transform. Position += velocity * speedamount * time. Deltatime;
}
}
Hatam olan kısmı of diye göstermekte Unity'e yeni başladım ne yapmalıyım?