Hello,
I am new to coding and mostly use Playmaker, but I have two asset store assets I want to get working together so I’m trying to edit the damage component of one to apply to the other. I keep getting the namespace error even if I add it to the ‘using’ field at the start which is what every answer on google suggests. Anyone able to help me out? Code for the two scripts are below, both located in the assets folder but under different sub folders.
using System;
using System.Collections.Generic;
using UnityEngine;
namespace DestroyIt
{
/// <summary>Put this script on an object you want to be destructible.</summary>
[DisallowMultipleComponent]
public class Destructible : MonoBehaviour
^ This is the code for the object I want to damage
if (Physics.Raycast(BulletOrigin.position, direction, out var hit, BulletRange, HitMask, QueryTriggerInteraction.Ignore))
{
OnHit(hit, BulletOrigin.forward);
hitLocation = hit.point;
Destructible destructible = hit.transform.GetComponent<Destructible>();
if (destructible != null)
{
destructible.ApplyDamage(GunDamage);
}
^ This is the code that is giving me the namespace error, even if I put using DestroyIt or using Destructible at the start. Edit: Error is on line 5, Unity says that the namespace ‘Destructible’ could not be found.
If you need to see more code to help, let me know, I tried to put only the necessary bits as they are paid assets.
Thanks in advance.