View Format: Multi-Page Single Page
All Docs Documentation Version: Base (Free) Influence System Modifier System

Troubleshooting Guide

Common issues and solutions for Simple Attribute Forge. Updated for the modern three-tier value system.

Installation & Setup Issues

Wizard Menu Missing

Problem: "Window → Simple Attribute Forge" menu doesn't appear
Solutions:

Compilation Errors

Problem: Red errors in Console preventing compilation
Solutions:

Generated Files Not Appearing

Problem: Wizard completes but no files generated
Solutions:

Runtime & Usage Issues

Values Not Updating Correctly

Problem: Attribute values don't behave as expected
Common Causes & Solutions:
// ❌ WRONG - Common mistakes float damage = strength.baseValue * weapon; // Missing bonuses! float health = healthAttr.value; // Property doesn't exist strength.formulaBonus += 10; // Will be overwritten! // ✅ CORRECT - Modern patterns float damage = strength.totalValue * weapon; // Includes all bonuses float health = healthAttr.currentValue; // For Vitals float maxHealth = healthAttr.totalValue; // For max values

Regeneration Not Working

Problem: Vital attributes don't regenerate automatically
Checklist:
// ✅ Correct way to enable regeneration health.canRegenerate = true; health.regenerationRate = 5.0f; // 5 HP per second health.regenerationDelay = 3.0f; // 3 second delay // ✅ Correct way to trigger regeneration health.ModifyValue(-30f); // Triggers regen after delay // ❌ Wrong way - won't trigger regeneration health.SetValue(health.currentValue - 30f); // Administrative change

Events Not Firing

Problem: Attribute events not triggering UI updates
Solutions:
// ✅ Correct event subscription void Start() { var attributes = GetComponent<CharacterAttributes>(); // Individual attribute events attributes.health.OnValueChanged += UpdateHealthUI; attributes.health.OnReachedZero += HandleDeath; // Component-wide events attributes.OnAnyAttributeChanged += LogAttributeChange; } void OnDestroy() { // ✅ Always unsubscribe to prevent memory leaks if (attributes?.health != null) { attributes.health.OnValueChanged -= UpdateHealthUI; attributes.health.OnReachedZero -= HandleDeath; } }

Code Generation Issues

Compilation Errors After Generation

Problem: Generated code has compilation errors
Solutions:

Component Not Appearing in Add Component Menu

Problem: Generated MonoBehaviour not available
Solutions:

ScriptableObject Asset Issues

Problem: Generated .asset file not working properly
Solutions:

Three-Tier Value System Issues

Bonuses Not Showing

Problem: formulaBonus or modifierBonus not reflecting in totalValue
Debug Steps:
// Debug attribute values public void DebugAttributeValues() { var attr = attributes.GetRuntimeAttribute("Strength"); Debug.Log($"STR Base: {attr.baseValue}"); Debug.Log($"STR Formula: {attr.formulaBonus}"); Debug.Log($"STR Modifier: {attr.modifierBonus}"); Debug.Log($"STR Total: {attr.totalValue}"); Debug.Log($"Expected: {attr.baseValue + attr.formulaBonus + attr.modifierBonus}"); }

Values Accumulating Incorrectly

Problem: Attribute values growing unexpectedly over time
Common Causes:
// ✅ Correct formula input (Ultimate's Influence System) // Formulas should read baseValue to prevent accumulation float strengthBonus = strength.baseValue * 0.5f; // ✅ Correct modifier management public void ApplyTemporaryBuff(float amount, float duration) { attribute.modifierBonus += amount; // Apply StartCoroutine(RemoveBuffAfterDelay(amount, duration)); } IEnumerator RemoveBuffAfterDelay(float amount, float duration) { yield return new WaitForSeconds(duration); attribute.modifierBonus -= amount; // Remove }

Performance Issues

High CPU Usage

Problem: Attribute system causing performance drops
Optimizations:
// ✅ Performance-optimized patterns public class OptimizedAttributeUI : MonoBehaviour { private SimpleRuntimeAttribute health; // Cache reference private float lastUpdateTime; private float updateInterval = 0.1f; // Throttle updates void Start() { health = GetComponent<CharacterAttributes>().health; health.OnValueChanged += MarkDirty; // Event-driven updates } void Update() { if (isDirty && Time.time - lastUpdateTime > updateInterval) { UpdateUI(); lastUpdateTime = Time.time; isDirty = false; } } }

Memory Leaks

Problem: Memory usage grows over time
Prevention:

Integration Issues

Ultimate Integration

Problem: Simple Attribute Forge Ultimate subsystems not working with generated attributes
Requirements:

Save/Load System

Problem: Attributes not saving/loading correctly
Best Practices:
// ✅ Correct save/load pattern [System.Serializable] public class AttributeSaveData { public Dictionary<string, float> baseValues = new(); public Dictionary<string, float> currentValues = new(); // Vitals only // DON'T save formulaBonus or modifierBonus } void SaveAttributes() { foreach (var kvp in attributes.GetAllRuntimeAttributes()) { var attr = kvp.Value; saveData.baseValues[attr.attributeName] = attr.baseValue; if (attr.behaviorType == SimpleBehaviorType.Vital) saveData.currentValues[attr.attributeName] = attr.currentValue; } }

Getting Help

Check Documentation

Debug Tools

  • Context Menu: Right-click component → "Log All Attributes"
  • Inspector Values: Use "Set Attribute Value" for testing
  • Debug Regeneration: "Debug Active Regeneration" shows coroutines

Common Debug Code

// Log all attribute states [ContextMenu("Debug All Attributes")] void DebugAll() { foreach(var attr in GetAllRuntimeAttributes().Values) { Debug.Log($"{attr.attributeName}: {attr.baseValue} + {attr.formulaBonus} + {attr.modifierBonus} = {attr.totalValue}"); } }

Support

  • Check Unity Console for detailed error messages
  • Try regenerating components with latest wizard
  • Test with fresh Unity project to isolate issues
  • Include error messages when seeking help
Most Common Fix: Many issues are resolved by updating code from the old .value property to the modern three-tier system using .totalValue, .currentValue, and .baseValue appropriately.