Error Codes
Complete reference guide for all Animatix Pro error codes and troubleshooting solutions. This comprehensive guide provides detailed information about every error, their causes, and step-by-step solutions.
🚨 Animation Errors
ANIM_001: Target Object Not Found
Error Code: ANIM_001
Severity: Error
Description: The target object for animation is null or missing.
Common Causes:
- Object was destroyed before animation started
- Object reference was not assigned
- Object is inactive in hierarchy
Solutions:
-
Check Object Reference:
if (targetObject == null)
{
Debug.LogError("Target object is null. Please assign a valid object.");
return;
} -
Verify Object is Active:
if (!targetObject.activeInHierarchy)
{
targetObject.SetActive(true);
} -
Use Object Pooling:
// For frequently created/destroyed objects
GameObject pooledObject = ObjectPooler.Instance.GetPooledObject();
if (pooledObject != null)
{
targetObject = pooledObject;
}
ANIM_002: Invalid Animation Duration
Error Code: ANIM_002
Severity: Error
Description: Animation duration is invalid (negative, zero, or too large).
Common Causes:
- Duration set to negative value
- Duration set to zero
- Duration exceeds maximum allowed value
Solutions:
-
Validate Duration:
if (duration <= 0f)
{
duration = 1f; // Default duration
Debug.LogWarning("Invalid duration, using default value of 1 second.");
} -
Clamp Duration:
duration = Mathf.Clamp(duration, 0.1f, 60f);
-
Use Safe Duration:
public float SafeDuration
{
get { return Mathf.Max(0.1f, Mathf.Min(60f, duration)); }
}
ANIM_003: Easing Curve Not Found
Error Code: ANIM_003
Severity: Warning
Description: The specified easing curve type is not implemented.
Common Causes:
- Easing type enum value is invalid
- Easing curve is not implemented
- Easing type is null
Solutions:
-
Use Default Easing:
if (!Enum.IsDefined(typeof(EasingType), easingType))
{
easingType = EasingType.EaseOut;
Debug.LogWarning("Invalid easing type, using EaseOut as default.");
} -
Implement Missing Easing:
public float EvaluateEasing(float t, EasingType type)
{
switch (type)
{
case EasingType.EaseOut:
return 1f - Mathf.Pow(1f - t, 3f);
default:
return t; // Linear fallback
}
}
ANIM_004: Animation Already Running
Error Code: ANIM_004
Severity: Warning
Description: Attempting to start an animation that is already running.
Common Causes:
- Animation started multiple times
- Previous animation not properly stopped
- Concurrent animation conflicts
Solutions:
-
Check Animation State:
if (isAnimating)
{
Debug.LogWarning("Animation already running, stopping previous animation.");
StopAnimation();
} -
Use Animation Queue:
if (isAnimating)
{
animationQueue.Enqueue(newAnimation);
return;
} -
Force Stop and Restart:
if (isAnimating)
{
StopAnimation();
yield return new WaitForEndOfFrame();
}
StartAnimation();
🎯 Trigger Errors
TRIG_001: Trigger Target Not Found
Error Code: TRIG_001
Severity: Error
Description: The target object for trigger is null or missing.
Common Causes:
- Button reference not assigned
- Collider reference missing
- Mouse target object destroyed
Solutions:
-
Validate Button Reference:
if (targetButton == null)
{
Debug.LogError("Target button is null. Please assign a valid button.");
return;
} -
Find Button Automatically:
if (targetButton == null)
{
targetButton = GetComponent<Button>();
if (targetButton == null)
{
targetButton = FindObjectOfType<Button>();
}
} -
Use Safe Button Access:
public Button SafeTargetButton
{
get
{
if (targetButton == null)
{
targetButton = GetComponent<Button>();
}
return targetButton;
}
}
TRIG_002: Invalid Trigger Condition
Error Code: TRIG_002
Severity: Error
Description: The trigger condition expression is invalid or cannot be evaluated.
Common Causes:
- Syntax error in condition string
- Undefined variables in condition
- Invalid operators used
Solutions:
-
Validate Condition Syntax:
try
{
bool result = EvaluateCondition(condition);
}
catch (Exception e)
{
Debug.LogError($"Invalid trigger condition: {e.Message}");
condition = "true"; // Safe fallback
} -
Use Safe Condition Evaluation:
public bool SafeEvaluateCondition(string condition)
{
try
{
return EvaluateCondition(condition);
}
catch
{
Debug.LogWarning("Condition evaluation failed, returning false.");
return false;
}
} -
Pre-validate Conditions:
public bool IsValidCondition(string condition)
{
// Check for basic syntax errors
if (string.IsNullOrEmpty(condition)) return false;
if (condition.Contains("undefined")) return false;
return true;
}
TRIG_003: Trigger Cooldown Active
Error Code: TRIG_003
Severity: Info
Description: Trigger is in cooldown period and cannot fire.
Common Causes:
- Cooldown timer still active
- Rapid trigger attempts
- Cooldown value too high
Solutions:
-
Check Cooldown Status:
if (Time.time - lastTriggerTime < cooldown)
{
Debug.Log("Trigger in cooldown, ignoring trigger attempt.");
return;
} -
Adjust Cooldown Value:
if (cooldown > 1f)
{
cooldown = 0.5f; // Reduce cooldown
Debug.LogWarning("Cooldown too high, reducing to 0.5 seconds.");
} -
Use Dynamic Cooldown:
public float DynamicCooldown
{
get { return Mathf.Max(0.1f, cooldown * 0.8f); }
}
🎛️ Control Errors
CTRL_001: Invalid Loop Count
Error Code: CTRL_001
Severity: Error
Description: Loop count is invalid (negative or too large).
Common Causes:
- Loop count set to negative value
- Loop count exceeds maximum allowed
- Infinite loop without proper exit condition
Solutions:
-
Validate Loop Count:
if (loopCount < 0)
{
loopCount = 1; // Default to single loop
Debug.LogWarning("Invalid loop count, using default value of 1.");
} -
Clamp Loop Count:
loopCount = Mathf.Clamp(loopCount, 0, 1000);
-
Use Safe Loop Count:
public int SafeLoopCount
{
get { return Mathf.Max(0, Mathf.Min(1000, loopCount)); }
}
CTRL_002: Empty Node List
Error Code: CTRL_002
Severity: Warning
Description: Node list is empty or contains null elements.
Common Causes:
- No nodes assigned to sequence/parallel
- Null nodes in the list
- Nodes removed after assignment
Solutions:
-
Validate Node List:
if (nodeList == null || nodeList.Length == 0)
{
Debug.LogWarning("Node list is empty, skipping execution.");
return;
} -
Filter Null Nodes:
nodeList = nodeList.Where(node => node != null).ToArray();
-
Use Safe Node List:
public Node[] SafeNodeList
{
get
{
if (nodeList == null) return new Node[0];
return nodeList.Where(node => node != null).ToArray();
}
}
CTRL_003: Condition Evaluation Failed
Error Code: CTRL_003
Severity: Error
Description: Condition node failed to evaluate its condition.
Common Causes:
- Invalid condition syntax
- Missing variables in condition
- Runtime evaluation error
Solutions:
-
Safe Condition Evaluation:
public bool SafeEvaluateCondition()
{
try
{
return EvaluateCondition(condition);
}
catch (Exception e)
{
Debug.LogError($"Condition evaluation failed: {e.Message}");
return false; // Safe fallback
}
} -
Validate Condition Before Use:
if (string.IsNullOrEmpty(condition))
{
Debug.LogError("Condition is empty, using false as default.");
return false;
} -
Use Fallback Condition:
public string SafeCondition
{
get { return string.IsNullOrEmpty(condition) ? "true" : condition; }
}
✨ Effect Errors
EFF_001: Particle System Not Found
Error Code: EFF_001
Severity: Error
Description: Particle system component is missing or null.
Common Causes:
- Particle system not assigned
- Particle system component missing
- Particle system destroyed
Solutions:
-
Find Particle System:
if (particleSystem == null)
{
particleSystem = GetComponent<ParticleSystem>();
if (particleSystem == null)
{
particleSystem = FindObjectOfType<ParticleSystem>();
}
} -
Create Particle System:
if (particleSystem == null)
{
GameObject particleObj = new GameObject("ParticleSystem");
particleSystem = particleObj.AddComponent<ParticleSystem>();
} -
Use Safe Particle System:
public ParticleSystem SafeParticleSystem
{
get
{
if (particleSystem == null)
{
particleSystem = GetComponent<ParticleSystem>();
}
return particleSystem;
}
}
EFF_002: Audio Source Not Found
Error Code: EFF_002
Severity: Error
Description: Audio source component is missing or null.
Common Causes:
- Audio source not assigned
- Audio source component missing
- Audio source destroyed
Solutions:
-
Find Audio Source:
if (audioSource == null)
{
audioSource = GetComponent<AudioSource>();
if (audioSource == null)
{
audioSource = FindObjectOfType<AudioSource>();
}
} -
Create Audio Source:
if (audioSource == null)
{
audioSource = gameObject.AddComponent<AudioSource>();
} -
Use Safe Audio Source:
public AudioSource SafeAudioSource
{
get
{
if (audioSource == null)
{
audioSource = GetComponent<AudioSource>();
}
return audioSource;
}
}
EFF_003: Invalid Effect Parameters
Error Code: EFF_003
Severity: Warning
Description: Effect parameters are invalid or out of range.
Common Causes:
- Intensity value out of range
- Duration value invalid
- Color values invalid
Solutions:
-
Validate Parameters:
intensity = Mathf.Clamp(intensity, 0f, 2f);
duration = Mathf.Clamp(duration, 0.1f, 10f); -
Use Safe Parameters:
public float SafeIntensity
{
get { return Mathf.Clamp(intensity, 0f, 2f); }
} -
Reset to Defaults:
if (intensity < 0f || intensity > 2f)
{
intensity = 1f; // Default intensity
Debug.LogWarning("Invalid intensity, using default value.");
}
🛠️ Custom Errors
CUST_001: Custom Action Failed
Error Code: CUST_001
Severity: Error
Description: Custom action execution failed.
Common Causes:
- Action method not found
- Invalid parameters passed
- Runtime execution error
Solutions:
-
Validate Action Method:
if (string.IsNullOrEmpty(actionName))
{
Debug.LogError("Action name is empty.");
return;
} -
Safe Action Execution:
try
{
ExecuteAction(actionName, parameters);
}
catch (Exception e)
{
Debug.LogError($"Custom action failed: {e.Message}");
} -
Use Fallback Action:
if (!HasAction(actionName))
{
Debug.LogWarning($"Action '{actionName}' not found, using fallback.");
ExecuteFallbackAction();
}
CUST_002: Script Execution Failed
Error Code: CUST_002
Severity: Error
Description: Script node execution failed.
Common Causes:
- Invalid script syntax
- Missing script dependencies
- Runtime script error
Solutions:
-
Validate Script Syntax:
if (string.IsNullOrEmpty(script))
{
Debug.LogError("Script is empty.");
return;
} -
Safe Script Execution:
try
{
return ExecuteScript(script, parameters);
}
catch (Exception e)
{
Debug.LogError($"Script execution failed: {e.Message}");
return null;
} -
Use Script Validation:
if (!IsValidScript(script))
{
Debug.LogError("Invalid script syntax.");
return;
}
CUST_003: Event Broadcasting Failed
Error Code: CUST_003
Severity: Warning
Description: Event broadcasting failed.
Common Causes:
- Event target not found
- Event system not initialized
- Invalid event data
Solutions:
-
Validate Event Target:
if (target == null)
{
Debug.LogWarning("Event target is null, broadcasting globally.");
BroadcastEvent(eventName, eventData);
} -
Safe Event Broadcasting:
try
{
BroadcastEvent(eventName, eventData, target);
}
catch (Exception e)
{
Debug.LogError($"Event broadcasting failed: {e.Message}");
} -
Use Event Queue:
if (!CanBroadcastEvent())
{
eventQueue.Enqueue(new EventData(eventName, eventData, target));
}
🔧 System Errors
SYS_001: Graph Executor Not Found
Error Code: SYS_001
Severity: Error
Description: Graph executor component is missing.
Common Causes:
- Graph executor not assigned
- Component missing from object
- Object not properly initialized
Solutions:
-
Find Graph Executor:
if (graphExecutor == null)
{
graphExecutor = GetComponent<GraphExecutor>();
if (graphExecutor == null)
{
graphExecutor = gameObject.AddComponent<GraphExecutor>();
}
} -
Validate Graph Executor:
if (graphExecutor == null)
{
Debug.LogError("Graph executor is required but not found.");
return;
} -
Use Safe Graph Executor:
public GraphExecutor SafeGraphExecutor
{
get
{
if (graphExecutor == null)
{
graphExecutor = GetComponent<GraphExecutor>();
}
return graphExecutor;
}
}
SYS_002: Graph Flow Asset Not Found
Error Code: SYS_002
Severity: Error
Description: Graph flow asset is null or missing.
Common Causes:
- Asset not assigned
- Asset file missing
- Asset not loaded
Solutions:
-
Load Asset:
if (graphFlowAsset == null)
{
graphFlowAsset = Resources.Load<GraphFlowAsset>("DefaultGraphFlow");
} -
Validate Asset:
if (graphFlowAsset == null)
{
Debug.LogError("Graph flow asset is required but not found.");
return;
} -
Use Fallback Asset:
public GraphFlowAsset SafeGraphFlowAsset
{
get
{
if (graphFlowAsset == null)
{
graphFlowAsset = CreateDefaultGraphFlow();
}
return graphFlowAsset;
}
}
SYS_003: Memory Allocation Failed
Error Code: SYS_003
Severity: Error
Description: Memory allocation failed during animation execution.
Common Causes:
- Insufficient memory
- Memory fragmentation
- Large animation data
Solutions:
-
Check Memory Usage:
if (System.GC.GetTotalMemory(false) > maxMemory)
{
System.GC.Collect();
} -
Use Object Pooling:
// Use pooled objects instead of creating new ones
GameObject pooledObject = ObjectPooler.Instance.GetPooledObject(); -
Optimize Memory Usage:
// Use structs instead of classes where possible
// Limit animation data size
// Clean up unused references
🚀 Performance Errors
PERF_001: Frame Rate Too Low
Error Code: PERF_001
Severity: Warning
Description: Frame rate is below acceptable threshold.
Common Causes:
- Too many concurrent animations
- Complex animation calculations
- Inefficient rendering
Solutions:
-
Limit Concurrent Animations:
if (activeAnimations.Count > maxConcurrentAnimations)
{
Debug.LogWarning("Too many concurrent animations, limiting to " + maxConcurrentAnimations);
// Stop oldest animations
} -
Optimize Animation Performance:
// Use simpler easing curves
// Reduce animation frequency
// Use LOD for distant objects -
Use Performance Monitoring:
if (Time.deltaTime > maxFrameTime)
{
Debug.LogWarning("Frame time too high, optimizing animations.");
OptimizeAnimations();
}
PERF_002: Animation Queue Full
Error Code: PERF_002
Severity: Warning
Description: Animation queue has reached maximum capacity.
Common Causes:
- Queue size limit reached
- Animations not processing fast enough
- Queue not being cleared
Solutions:
-
Increase Queue Size:
if (animationQueue.Count >= maxQueueSize)
{
maxQueueSize *= 2;
Debug.LogWarning("Animation queue full, increasing size to " + maxQueueSize);
} -
Process Queue Faster:
// Increase processing frequency
// Use coroutines for better performance
// Batch process animations -
Clear Old Animations:
if (animationQueue.Count >= maxQueueSize)
{
// Remove oldest animations
while (animationQueue.Count > maxQueueSize / 2)
{
animationQueue.Dequeue();
}
}
🎉 Error Prevention Tips
Best Practices
- Always validate inputs before using them
- Use null checks for all object references
- Implement fallback values for critical parameters
- Monitor performance regularly
- Test error conditions during development
Debugging Tools
- Enable detailed logging in development builds
- Use breakpoints for complex error scenarios
- Profile memory usage regularly
- Monitor frame rates during testing
- Test on various devices and platforms
Error Recovery
- Implement graceful degradation for non-critical errors
- Use try-catch blocks for risky operations
- Provide user feedback for recoverable errors
- Log errors for debugging purposes
- Restart systems when necessary
🎉 What's Next?
Now that you understand all error codes:
📚 Learn More
- Changelog - Version history
- FAQ - Frequently asked questions
- Troubleshooting - Common issues
🎯 Try These Examples
- UI/UX Examples - Complete UI examples
- Gameplay Sequences - Game examples
- Advanced Techniques - Complex workflows
🎊 Error Codes mastery achieved! You're ready to troubleshoot any issue!
Let's check the changelog! Check out the Changelog guide!