- 4 Tem 2021
- 210
- 11
Merhaba ben Unity 2 d üzerinden bir mobil oyun yapmak istiyorum fakat yazdığım script te bir hata çıktı bana yardımcı olur musunuz.
SCRİPT:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class oyuncuhareket : MonoBehaviour
{
public float speed;
void Update()
{
transform.position += Vector3(speed, 0, 0) * Time.deltaTime * 1;
}
public void SagaGit()
{
speed = 1;
}
public void SoloGit()
{
speed = -1;
}
public void Zipla()
{
}
public void Dur()
{
speed = 0;
}
SCRİPT:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class oyuncuhareket : MonoBehaviour
{
public float speed;
void Update()
{
transform.position += Vector3(speed, 0, 0) * Time.deltaTime * 1;
}
public void SagaGit()
{
speed = 1;
}
public void SoloGit()
{
speed = -1;
}
public void Zipla()
{
}
public void Dur()
{
speed = 0;
}