Troubleshooting
Comprehensive troubleshooting guide for Animatix Pro. This guide helps you diagnose and fix common issues, performance problems, and technical difficulties.
🚨 Common Issues
Animation Not Playing
Symptoms: Animation doesn't start or play properly.
Possible Causes:
- Target object is null or inactive
- Animation duration is zero or negative
- Graph executor is not properly initialized
- Animation is paused or stopped
Solutions:
-
Check Target Object:
if (targetObject == null)
{
Debug.LogError("Target object is null!");
return;
}
if (!targetObject.activeInHierarchy)
{
targetObject.SetActive(true);
} -
Validate Animation Duration:
if (duration <= 0f)
{
duration = 1f; // Set default duration
Debug.LogWarning("Invalid duration, using default value.");
} -
Check Graph Executor:
if (graphExecutor == null)
{
graphExecutor = GetComponent<GraphExecutor>();
if (graphExecutor == null)
{
graphExecutor = gameObject.AddComponent<GraphExecutor>();
}
} -
Verify Animation State:
if (graphExecutor.IsPaused())
{
graphExecutor.Resume();
}
else if (!graphExecutor.IsPlaying())
{
graphExecutor.Play();
}
Animation Playing Too Fast/Slow
Symptoms: Animation speed doesn't match expected timing.
Possible Causes:
- Incorrect duration values
- Time scale modifications
- Frame rate issues
- Easing curve problems
Solutions:
-
Check Duration Values:
Debug.Log($"Animation duration: {duration} seconds");
Debug.Log($"Time scale: {Time.timeScale}");
Debug.Log($"Frame rate: {1f / Time.deltaTime}"); -
Reset Time Scale:
Time.timeScale = 1f; // Reset to normal speed
-
Adjust for Frame Rate:
// Use unscaled time for consistent timing
float unscaledTime = Time.unscaledTime; -
Check Easing Curves:
// Verify easing curve is appropriate
if (easingType == EasingType.Linear)
{
// Linear should be consistent
}
Animation Stuttering or Choppy
Symptoms: Animation appears jerky or not smooth.
Possible Causes:
- Low frame rate
- Too many concurrent animations
- Complex calculations
- Memory issues
Solutions:
-
Check Frame Rate:
void Update()
{
float fps = 1f / Time.deltaTime;
if (fps < 30f)
{
Debug.LogWarning($"Low frame rate: {fps} FPS");
}
} -
Limit Concurrent Animations:
if (activeAnimations.Count > maxConcurrentAnimations)
{
Debug.LogWarning("Too many concurrent animations!");
// Stop oldest animations
StopOldestAnimations();
} -
Optimize Calculations:
// Use efficient easing calculations
float progress = elapsed / duration;
float easedProgress = EaseOut(progress); // Simple easing -
Check Memory Usage:
long memory = System.GC.GetTotalMemory(false);
if (memory > maxMemory)
{
System.GC.Collect();
}
Animation Not Stopping
Symptoms: Animation continues running when it should stop.
Possible Causes:
- Loop node set to infinite
- Stop method not called
- Animation state not properly managed
- Event system issues
Solutions:
-
Check Loop Settings:
if (loopCount == -1) // Infinite loop
{
Debug.LogWarning("Infinite loop detected!");
loopCount = 1; // Set to single loop
} -
Force Stop Animation:
if (graphExecutor.IsPlaying())
{
graphExecutor.Stop();
} -
Reset Animation State:
isAnimating = false;
currentProgress = 0f; -
Check Event Handlers:
// Ensure event handlers are properly unsubscribed
graphExecutor.OnAnimationCompleted -= OnAnimationCompleted;
🎯 Trigger Issues
Trigger Not Firing
Symptoms: Trigger conditions not activating animations.
Possible Causes:
- Trigger target not assigned
- Condition not met
- Cooldown active
- Event system not working
Solutions:
-
Check Trigger Target:
if (targetButton == null)
{
Debug.LogError("Trigger target not assigned!");
return;
} -
Debug Condition:
bool conditionMet = EvaluateCondition(condition);
Debug.Log($"Condition '{condition}' result: {conditionMet}"); -
Check Cooldown:
if (Time.time - lastTriggerTime < cooldown)
{
Debug.Log("Trigger in cooldown period");
return;
} -
Test Event System:
// Test if events are being received
void OnEnable()
{
targetButton.onClick.AddListener(OnButtonClick);
}
void OnDisable()
{
targetButton.onClick.RemoveListener(OnButtonClick);
}
Trigger Firing Too Often
Symptoms: Trigger activates multiple times when it should only fire once.
Possible Causes:
- Multiple event listeners
- Cooldown too short
- One-shot not working
- Event bubbling
Solutions:
-
Remove Duplicate Listeners:
void OnEnable()
{
targetButton.onClick.RemoveAllListeners();
targetButton.onClick.AddListener(OnButtonClick);
} -
Increase Cooldown:
cooldown = Mathf.Max(cooldown, 0.5f); // Minimum 0.5 seconds
-
Use One-Shot:
if (oneShot && hasTriggered)
{
return; // Don't trigger again
} -
Prevent Event Bubbling:
void OnButtonClick()
{
if (isProcessing) return;
isProcessing = true;
// Handle trigger
isProcessing = false;
}
Trigger Not Responding to Input
Symptoms: Trigger doesn't respond to user input.
Possible Causes:
- Input system not working
- Object not receiving input
- Raycast issues
- UI blocking input
Solutions:
-
Check Input System:
if (Input.GetMouseButtonDown(0))
{
Debug.Log("Mouse click detected");
} -
Verify Object Receives Input:
// Ensure object has collider and is in correct layer
if (GetComponent<Collider>() == null)
{
gameObject.AddComponent<BoxCollider>();
} -
Check Raycast:
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out RaycastHit hit))
{
Debug.Log($"Hit object: {hit.collider.name}");
} -
Check UI Blocking:
// Ensure UI doesn't block input
if (EventSystem.current.IsPointerOverGameObject())
{
return; // UI is blocking input
}
🎛️ Control Issues
Loop Not Working
Symptoms: Loop node doesn't repeat animations.
Possible Causes:
- Loop count set to zero
- Exit condition met immediately
- Animation not completing
- Loop state not managed
Solutions:
-
Check Loop Count:
if (loopCount <= 0)
{
Debug.LogError("Invalid loop count!");
return;
} -
Debug Exit Condition:
if (!string.IsNullOrEmpty(exitCondition))
{
bool shouldExit = EvaluateCondition(exitCondition);
Debug.Log($"Exit condition result: {shouldExit}");
} -
Ensure Animation Completes:
yield return new WaitUntil(() => !graphExecutor.IsPlaying());
// Animation completed, proceed with loop -
Manage Loop State:
int currentLoop = 0;
while (currentLoop < loopCount)
{
// Play animation
yield return new WaitUntil(() => !graphExecutor.IsPlaying());
currentLoop++;
}
Condition Not Evaluating
Symptoms: Condition node doesn't evaluate properly.
Possible Causes:
- Invalid condition syntax
- Missing variables
- Type mismatches
- Evaluation errors
Solutions:
-
Validate Condition Syntax:
if (string.IsNullOrEmpty(condition))
{
Debug.LogError("Condition is empty!");
return false;
} -
Check Variables:
foreach (var variable in parameters)
{
Debug.Log($"Variable: {variable.Key} = {variable.Value}");
} -
Handle Type Mismatches:
try
{
return EvaluateCondition(condition);
}
catch (Exception e)
{
Debug.LogError($"Condition evaluation failed: {e.Message}");
return false;
} -
Use Safe Evaluation:
public bool SafeEvaluateCondition()
{
try
{
return EvaluateCondition(condition);
}
catch
{
Debug.LogWarning("Condition evaluation failed, returning false");
return false;
}
}
Parallel Execution Issues
Symptoms: Parallel nodes don't execute simultaneously.
Possible Causes:
- Nodes not properly configured
- Execution order issues
- Resource conflicts
- Timing problems
Solutions:
-
Check Node Configuration:
if (nodeList == null || nodeList.Length == 0)
{
Debug.LogError("No nodes to execute in parallel!");
return;
} -
Start All Nodes Simultaneously:
foreach (var node in nodeList)
{
if (node != null)
{
node.Execute();
}
} -
Handle Resource Conflicts:
// Use different objects for parallel animations
// or ensure they don't conflict -
Check Timing:
float startTime = Time.time;
// All nodes should start at the same time
✨ Effect Issues
Particle Effects Not Playing
Symptoms: Particle system doesn't start or play properly.
Possible Causes:
- Particle system not assigned
- Particle system inactive
- Emission disabled
- Duration issues
Solutions:
-
Check Particle System:
if (particleSystem == null)
{
Debug.LogError("Particle system not assigned!");
return;
} -
Enable Emission:
var emission = particleSystem.emission;
emission.enabled = true; -
Start Particle System:
particleSystem.Play();
-
Check Duration:
if (duration > 0f)
{
StartCoroutine(StopParticlesAfterDuration());
}
Audio Not Playing
Symptoms: Audio clips don't play or play incorrectly.
Possible Causes:
- Audio source not assigned
- Audio clip not assigned
- Audio source muted
- Volume set to zero
Solutions:
-
Check Audio Source:
if (audioSource == null)
{
Debug.LogError("Audio source not assigned!");
return;
} -
Check Audio Clip:
if (audioClip == null)
{
Debug.LogError("Audio clip not assigned!");
return;
} -
Set Audio Properties:
audioSource.clip = audioClip;
audioSource.volume = volume;
audioSource.pitch = pitch;
audioSource.Play(); -
Check Audio Settings:
if (AudioListener.volume == 0f)
{
Debug.LogWarning("Audio listener volume is zero!");
}
Screen Effects Not Working
Symptoms: Screen shake, flash, or fade effects don't appear.
Possible Causes:
- Post-processing not enabled
- Effect intensity too low
- Camera not assigned
- Effect system not initialized
Solutions:
-
Check Post-Processing:
if (postProcessVolume == null)
{
Debug.LogError("Post-processing volume not assigned!");
return;
} -
Check Effect Intensity:
if (intensity <= 0f)
{
Debug.LogWarning("Effect intensity is zero!");
intensity = 1f;
} -
Verify Camera:
if (camera == null)
{
camera = Camera.main;
} -
Initialize Effect System:
if (!effectSystem.IsInitialized)
{
effectSystem.Initialize();
}
🚀 Performance Issues
Low Frame Rate
Symptoms: Game runs below 60fps.
Possible Causes:
- Too many concurrent animations
- Complex calculations
- Memory issues
- Inefficient code
Solutions:
-
Limit Concurrent Animations:
if (activeAnimations.Count > maxConcurrentAnimations)
{
// Stop oldest animations
StopOldestAnimations();
} -
Optimize Calculations:
// Use efficient easing functions
// Cache frequently used values
// Use object pooling -
Check Memory Usage:
long memory = System.GC.GetTotalMemory(false);
if (memory > maxMemory)
{
System.GC.Collect();
} -
Profile Performance:
// Use Unity Profiler to identify bottlenecks
Memory Leaks
Symptoms: Memory usage increases over time.
Possible Causes:
- Objects not being destroyed
- Event handlers not unsubscribed
- Cached data not cleared
- Circular references
Solutions:
-
Destroy Objects Properly:
void OnDestroy()
{
if (targetObject != null)
{
Destroy(targetObject);
}
} -
Unsubscribe from Events:
void OnDisable()
{
targetButton.onClick.RemoveListener(OnButtonClick);
} -
Clear Cached Data:
void ClearCache()
{
animationCache.Clear();
parameterCache.Clear();
} -
Check for Circular References:
// Ensure objects don't reference each other
// Use weak references where appropriate
Animation Stuttering
Symptoms: Animations appear choppy or stutter.
Possible Causes:
- Inconsistent frame rate
- Complex easing calculations
- Too many updates per frame
- Threading issues
Solutions:
-
Maintain Consistent Frame Rate:
Application.targetFrameRate = 60;
-
Simplify Easing Calculations:
// Use simpler easing functions
// Cache easing results -
Limit Updates per Frame:
if (Time.deltaTime > maxDeltaTime)
{
return; // Skip this frame
} -
Use Coroutines:
// Use coroutines for smooth animations
StartCoroutine(AnimateCoroutine());
🔧 Debugging Tips
Enable Debug Logging
// Enable detailed logging
Debug.Log($"Animation started: {animationName}");
Debug.Log($"Target object: {targetObject.name}");
Debug.Log($"Duration: {duration} seconds");
Debug.Log($"Easing: {easingType}");
Use Breakpoints
// Set breakpoints in critical code
void OnAnimationStarted()
{
Debug.Break(); // Pause execution here
// Check variable values
}
Profile Performance
// Use Unity Profiler
void Update()
{
if (Input.GetKeyDown(KeyCode.P))
{
Profiler.BeginSample("Animation Update");
// Your animation code here
Profiler.EndSample();
}
}
Check Object References
// Validate all object references
if (targetObject == null)
{
Debug.LogError("Target object is null!");
return;
}
if (graphExecutor == null)
{
Debug.LogError("Graph executor is null!");
return;
}
🎉 What's Next?
Now that you can troubleshoot common issues:
📚 Learn More
- Contact Support - Get help from our team
- Contributing - Contribute to the project
- FAQ - Frequently asked questions
🎯 Try These Examples
- UI/UX Examples - Complete UI examples
- Gameplay Sequences - Game examples
- Advanced Techniques - Complex workflows
🎊 Troubleshooting mastery achieved! You can fix any issue!
Need more help? Check out Contact Support!