In Combatant > Schematic Settings >Spawn Schematic > Enemy Schematic I set a schematic to spawn a vfx prefab.
This works when spawning the combatant using a Combatant Spawner, but doesn't work when spawning the combatant via code.
This is the function I use for spawning:

public GameObject CreateORKCombatants(string combatant_GUID, string faction_GUID, Vector3 position, Vector3 rotation, GameObject prefab)
{
FactionSetting _faction = ORK.Factions.Get(faction_GUID);
CombatantSetting _settings = ORK.Combatants.Get(combatant_GUID);
Combatant _combatant;
_combatant = ORK.Access.Combatant.CreateInstance(_settings, new Group(_faction), false, false);
_combatant.GameObject = Instantiate(prefab, position, Quaternion.Euler(rotation.x, rotation.y, rotation.z));
return _combatant.Object.GameObject;
}
  • The spawn schematic is used when you spawn the combatant, i.e. via it's Spawn functions (via combatant.Object.Spawn).
    You don't spawn the combatant, you set a game object for it :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I see...is there a way to enable those start schematics via code?
  • You can call them via code like this:
    combatant.Setting.schematicSettings.SpawnSchematics.StartSchematic(combatant, null);
    combatant naturally being the combatant instance :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • That worked like a charm, thank you Nicholas!
Sign In or Register to comment.