Topic: [Bug Report] Basic move particle effects not spawning at same time
I was experimenting with landing particle effects and noticed that the effect would not spawn at the same time.
Universal Fighting Engine Forum We are no longer using the forum to answer questions due to bot attacks. Please use our discord instead: https://discord.gg/hGMZhF7 |
You are not logged in. Please login or register.
Universal Fighting Engine Forum → General → [Bug Report] Basic move particle effects not spawning at same time
I was experimenting with landing particle effects and noticed that the effect would not spawn at the same time.
I see what is happening.
UFE has a special spawn system that works in conjunction with the netcode. To ensure optimal memory management, game objects stay alive in a spawn pool so they can be retrieved during rollbacks.
At the moment, particle effects spawn methods were designed with a weak unique id generator, and as a result, if the same particle gets spawned in the exact same frame by both players, this bug happens.
If you have UFE Source, here is a way to fix it:
Under MoveSetScript.cs, look for this line:
GameObject pTemp = UFE.SpawnGameObject(basicMove.particleEffect.prefab, newPosition, Quaternion.identity, Mathf.RoundToInt(basicMove.particleEffect.duration * UFE.config.fps));
And change it to this:
string uniqueId = basicMove.particleEffect.prefab.name + controlsScript.playerNum.ToString() + UFE.currentFrame;
GameObject pTemp = UFE.SpawnGameObject(basicMove.particleEffect.prefab, newPosition, Quaternion.identity, Mathf.RoundToInt(basicMove.particleEffect.duration * UFE.config.fps), false, uniqueId);
Tested those changes out, it works.
Universal Fighting Engine Forum → General → [Bug Report] Basic move particle effects not spawning at same time
Powered by PunBB, supported by Informer Technologies, Inc.