Hi guys, I just got this kit and I’ve fixed a lot of errors but this one stumps me. It’s claiming that I have an invalid token but I don’t know what to fix on it.
Error: Assets\ThunderWire Studio\UHFPS\Content\Scripts\Runtime\RenderFeatures\EffectFeature.cs(9,27): error CS1519: Invalid token ‘;’ in class, record, struct, or interface member declaration
The script itself:
using UnityEngine.Rendering;
using System;
namespace UHFPS.Rendering
{
[Serializable]
public abstract class EffectFeature
{
public RenderPass;
public bool Enabled = true;
public abstract string Name { get; }
public abstract void OnCreate();
public virtual OnGetRenderPass()
{
if (RenderPass == null)
return null;
RenderPass.ConfigureInput(ScriptableRenderPassInput.Color);
return RenderPass;
}
}
}
Again don’t know what to change or how to fix it. Thanks
Please use code tags.
For store assets, contact the asset developer for support.
The issue is obvious:
public RenderPass;
The type of the field is missing.
Since assets go through review, and there must not be any compile errors, I cannot imagine how this script went live on the store as is. Try creating a new project and import the asset into it. There should not be any compile errors, besides any compatibility errors due to changes in API or C# versions.
Sorry looks like I got the wrong script in there by accident. My bad. Again here is the error
Assets\ThunderWire Studio\UHFPS\Content\Scripts\Runtime\Interact\Other\CustomInteractEvent.cs(67,28): error CS0246: The type or namespace name ‘JToken’ could not be found (are you missing a using directive or an assembly reference?)
And the real script that goes with it
using UnityEngine.Events;
using UnityEngine;
using UHFPS.Tools;
using Newtonsoft.Json.Linq;
namespace UHFPS.Runtime
{
public class CustomInteractEvent : MonoBehaviour, IInteractStart, IInteractHold, IInteractStop, ISaveable
{
public bool UseOnStartEvent;
public bool UseOnHoldEvent;
public bool UseOnStopEvent;
public bool FreezePlayer;
public bool InteractOnce;
public bool UseInteractSound;
public SoundClip InteractSound;
public UnityEvent OnStart;
public UnityEvent OnHold;
public UnityEvent OnStop;
private PlayerPresenceManager playerPresence;
private bool isInteracted;
private void Awake()
{
playerPresence = PlayerPresenceManager.Instance;
}
public void InteractStart()
{
if (isInteracted)
return;
if (UseOnStartEvent) OnStart?.Invoke();
if (FreezePlayer) playerPresence.FreezePlayer(true);
if (UseInteractSound) GameTools.PlayOneShot2D(transform.position, InteractSound, “InteractSound”);
}
public void InteractHold(Vector3 point)
{
if (isInteracted)
return;
if (UseOnHoldEvent) OnHold?.Invoke(point);
}
public void InteractStop()
{
if (isInteracted)
return;
if (UseOnStopEvent) OnStop?.Invoke();
if (FreezePlayer) playerPresence.FreezePlayer(false);
if (InteractOnce) isInteracted = true;
}
public StorableCollection OnSave()
{
return new StorableCollection()
{
{ “interactOnce”, isInteracted }
};
}
public void OnLoad(JToken data)
{
isInteracted = (bool)data[“interactOnce”];
}
}
}
I already messaged the creator of horror fps kit as they don’t seem to message back. That’s why I asked on here as I’m trying to hit my deadline for my game and I can’t wait. Anyway thanks again.
Ok now another error has occurred stating an Identifier expected error. I can’t seem to find out where it is other than the lines 143 and 41 but this doesnt make sense. Again I can’t figure this out. Something in this code is wrong. I tried to message the dev of this kit but as I said, I’m hitting a deadline and I just need answers. If anyone can figure this out, let me know. Has anyone used Ultimate Horror FPS Kit yet? I tried importing to my blank project and even switching projects and it still gives me these errors. Anyway, thanks again.
What editor version are you on? The kit is compatible with Unity 2022.
If you happen to use an earlier Unity version that might explain issues due to older C# versions, for example this line is making use of the C# 9 feature where you can simply use “new()” instead of “new StorableCollection()”: