Hey i’m getting this error message and i’m not too sure whats causing it.
Assets\Scripts\Combat\CombatTarget.cs(12,48): error CS0535: 'CombatTarget' does not implement interface member 'IRaycastable.HandleRaycast(PlayerController)'
Assets\Scripts\Combat\WeaponPickup.cs(9,48): error CS0535: 'WeaponPickup' does not implement interface member 'IRaycastable.HandleRaycast(PlayerController)'
using System;
using System.Collections;
using System.Collections.Generic;
using RPG.Control;
using UnityEngine;
namespace RPG.Combat
{
public class WeaponPickup : MonoBehaviour, IRaycastable
{
[SerializeField] Weapon weapon = null;
[SerializeField] float respawnTime = 5;
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Player")
{
Pickup(other.GetComponent<Fighter>());
}
}
private void Pickup(Fighter fighter)
{
fighter.EquipWeapon(weapon);
StartCoroutine(HideForSeconds(respawnTime));
}
private IEnumerator HideForSeconds(float seconds)
{
ShowPickup(false);
yield return new WaitForSeconds(seconds);
ShowPickup(true);
}
private void ShowPickup(bool shouldShow)
{
GetComponent<Collider>().enabled = shouldShow;
foreach (Transform child in transform)
{
child.gameObject.SetActive(shouldShow);
}
}
public bool HandleRaycast(PlayerController callingController)
{
if (Input.GetMouseButtonDown(0))
{
Pickup(callingController.GetComponent<Fighter>());
}
return true;
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using RPG.Core;
using RPG.Attributes;
using RPG.Control;
namespace RPG.Combat
{
[RequireComponent(typeof(Health))]
public class CombatTarget : MonoBehaviour, IRaycastable
{
public bool HandleRaycast(PlayerController callingController)
{
if (!callingController.GetComponent<Fighter>().CanAttack(gameObject))
{
return false;
}
if (Input.GetMouseButton(0))
{
callingController.GetComponent<Fighter>().Attack(gameObject);
}
return true;
}
}
}
namespace RPG.Control
{
public interface IRaycastable
{
bool HandleRaycast(PlayerController callingController);
}
}