Ошибки в скрипте с# Assets/strelat.cs(15,13): error CS0029: Cannot implicitly convert type `float' to `bool' и Assets/s
скрипт :
using System.Collections;
using UnityEngine;
public class strelat : MonoBehaviour {
public GameObject Bullet;
public GameObject StartStwol;
void FixedUpdate() {
fire ();
}
void fire () {
if (Input.GetAxis ("Fire1")) {
Vector3 SpawnPoint = StartStwol.transform.position;
Quaternion SpawnRoot = StartStwol.transform.position;
GameObject Pula_for_fier = Instantiate (Bullet, SpawnPoint, SpawnRoot) as GameObject;
Rigidbody Run = Pula_for_fier.GetComponent ();
Run.AddForce (Pula_for_fier.transform.forward * 30, ForceMode.Impulse);
}
}
}
По дате
По рейтингу
Input.GetAxis ("Fire1") возвращает число, а не bool. Его ты можешь проверить на предмет больше/меньше.