#How should I use the 'IStaminaModifier' to give the player unlimited stamina?
1 messages · Page 1 of 1 (latest)
additionally, I consulted some form SecretAPI @safe jolt thanks
https://github.com/obvEve/SecretAPI/blob/master/SecretAPI/Features/Effects/CustomPlayerEffect.cs
You have to register the effects on player prefab
internal static void Initialize()
{
// wait for scene to load to make sure prefab is loaded
SceneManager.sceneLoaded += Load;
}
private static void Load(Scene scene, LoadSceneMode mode)
{
SceneManager.sceneLoaded -= Load;
Transform playerEffects = NetworkManager.singleton.playerPrefab.GetComponent<PlayerEffectsController>().effectsGameObject.transform;
foreach (Type type in Constants.Types)
{
if (type.IsAbstract)
continue;
if (!type.IsSubclassOf(typeof(CustomPlayerEffect)))
continue;
// register effect into prefab
new GameObject(type.Name, type).transform.parent = playerEffects;
}
}
this is currently how i handle it another repo
apply it to NetworkManager.singleton.playerPrefab with the effects and then you dont need to do it on every player join
Is this the source of the problem that causes me to be different on my local machine than on the remote server? I am even more puzzled about this
It could be
I cant tell you for sure, but it works for me without issue
well did, i havent tested on latest update
@steady grail Did this fix it?
on my local server side it works fine, I will continue testing on remote server tomorrow(about 16 hours later maybe)
not work on remote server, I can't understand why...

Even more strangely, it only seems to work for certain roles
