In this lesson, you will learn how to use Unreal Insights to pinpoint exactly when physics calculations or complex animation graphs are consuming your frame budget.
When performance dips occur, it is often difficult to distinguish between high draw calls, costly shader math, or simulation overhead. To isolate physics and animation, we look for specific CPU tracks in the Unreal Insights Timing trace.
Profiling Animation Blueprints
Animation blueprints can become performance sinks if you execute heavy logic in the Update graph. When reviewing your trace, search for the AnimGraph scope within the TaskGraph threads. If you see high execution times here, your animation blueprint is likely performing expensive lookups, complex transitions, or excessive Cast operations.
To optimize, ensure you are utilizing the Animation Fast Path. If your graph nodes are simple property accessors rather than complex logic, they will show up as Fast Path in your profile. If you see custom Blueprint nodes executing instead, that is a clear indicator that you should move that logic into C++ or use the Animation Budget Allocator to throttle updates for distant characters.
Profiling Physics Simulations
Physics bottlenecks typically manifest as long spikes under the PhysX or Chaos category within the Game thread or specialized physics tasks. High physics costs are usually caused by:
- Complex Collision Mesh Complexity: If your trace shows high
SceneQueryorContactGentimes, your static meshes have too many triangles in their collision hulls. - Excessive Overlap Events: Every time two objects overlap, the physics engine triggers callbacks. You can verify this by filtering for
PhysicsCallbackin the Insights timeline.
To diagnose these, use the console command p.VisualizePhysics 1 while simultaneously recording an Insights trace. This allows you to correlate specific simulation spikes with the actual actors colliding in your level. If you find a specific actor is causing consistent spikes, consider simplifying its collision primitive or switching it to a "Static" mobility type to remove it from the dynamic physics simulation.
Key Takeaway: Use Unreal Insights to isolate AnimGraph execution times and PhysX/Chaos task spikes; prioritize shifting complex Blueprint nodes to the Fast Path and simplifying collision complexity for high-cost actors.