I can swap unarmed and armed. However, I cannot pickup weapons. my script seems fine, I added in a collier and rigidbody and nothing. Any suggestion using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace RPG.Combat
{
public class WeaponPickup : MonoBehaviour
{
[SerializeField] Weapon weapon = null;
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Player")
{
other.GetComponent<Fighter>().EquipWeapon(weapon);
Destroy(gameObject);
}
}
}
}