error CS0200: Property or indexer 'Collision.gameObject' cannot be assigned to -- it is read only как решить проблему в Unity?

Помогите пожалуйста со скриптом для пули на 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);
     }
 }    
}

Ответы (1 шт):

Автор решения: Igor
if (other.gameObject.name == "Enemy")
                      
→ Ссылка