Помогите пожалуйста со скриптом для пули на C#. Я плохо знаю C# и не могу понять как эту проблему решить в строке: if (other.gameObject = "Enemy").
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Bullet : MonoBehaviour
{
public float speed = 65f;
Rigidbody rb;
public float lifetimer = 2f;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void Update()
{
transform.position += transform.forward * speed * Time.deltaTime;
lifetimer -= Time.deltaTime;
if (lifetimer <= 0f)
{
Destroy(gameObject);
}
}
private void OnCollisionEnter(Collision collision)
{
Destroy(gameObject);
}
private void OnTriggerEnter(Collision other)
{
if (other.gameObject = "Enemy") // здесь ошибка
{
other.gameObject.GetComponent<Enemy>().TakeDamage(1);
}
}
}