Lyra Integration Guide
Complete guide to integrating the AI Turret plugin with Epic Games' Lyra sample project.
Overview
The AI Turret plugin can be seamlessly integrated with Lyra, Epic's advanced multiplayer shooter sample project. This integration allows you to add intelligent defensive turrets to your Lyra-based games, complete with team-based targeting and Gameplay Ability System (GAS) compatibility.
What This Integration Enables
- Team-based AI turrets that recognize friend vs foe
- GAS integration for damage dealing through Gameplay Effects
- Lyra's advanced networking support for multiplayer scenarios
- Professional game-ready defensive systems
Prerequisites
Before starting this integration, ensure you have:
- ✅ Lyra project set up and running
- ✅ AI Turret plugin installed and enabled
- ✅ Basic Lyra knowledge (teams, GAS, ShooterCore)
- ✅ Blueprint editing experience
Step-by-Step Integration
1. Install AI Turret Plugin
First, install the AI Turret plugin in your Lyra project following the standard Setup Guide.
2. Add Plugin Dependency
Configure the plugin dependency to access ShooterCore functionality:
- Right-click the ShooterCore Content folder
- Select Plugin → Edit
- Under Dependencies, add AITurret
- Save and restart Unreal Engine
3. Create Damage Gameplay Effect
Create a custom Gameplay Effect for turret damage:
- Navigate to AITurret Content folder
- Create a new Gameplay Effect blueprint
- Copy
ShooterCore/Content/Weapons/Rifle/GE_Damage_RifleAuto
- Paste it to the AITurret Content folder
- Rename it to GE_Damage_Turret
- (Optional) Modify damage values as needed
4. Modify B_TurretPawn Event Graph
Update the turret pawn to apply damage through the Gameplay Ability System:
OnProjectileImpact Event Implementation
Blueprint showing the OnProjectileImpact event handling with authority checks and GAS integration.
5. Configure B_TurretAIController
Either delete the GetTeamAttitude function entirely (so the default C++ implementation is used) or ensure the AI controller uses proper team attitude detection by calling the parent implementation.
GetTeamAttitude Function Override
Blueprint showing the GetTeamAttitude function override that ensures proper team recognition in Lyra.
6. Configure Team Settings
Set up proper team identification:
- Place B_TurretPawn in your level
- Set the Team ID to match one of your teams (e.g., Team 1)
- Ensure player characters have corresponding team IDs
- Test team recognition in play mode
7. Fine-tune Performance Settings
Optimize turret behavior for your Lyra project:
Recommended Settings in B_TurretPawn:
- Projectile Velocity:
10000
(for fast projectiles) - Damage Amount: Adjust in
GE_Damage_Turret
Recommended Settings in B_TurretAIController:
- Sight Radius:
1500-3000
(depending on map size) - Peripheral Vision Angle:
90-135
degrees - Hearing Range: Match your game's audio design
Video Demonstration
Watch this comprehensive demonstration of the Lyra integration in action:
The video shows the complete integration process and demonstrates the turrets working within a Lyra environment.
Blueprint Code Reference
B_TurretPawn OnProjectileImpact Implementation
Click to expand full BlueprintUE code to copy&paste into UE
Begin Object Class=/Script/BlueprintGraph.K2Node_Event Name="K2Node_Event_3"
EventReference=(MemberParent="/Script/CoreUObject.Class'/Script/AITurret.TurretPawn'",MemberName="OnProjectileImpact")
bOverrideFunction=True
NodePosX=-496
NodePosY=269
NodeGuid=72A4765F458C18C224D904943496E3EC
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_MacroInstance Name="K2Node_MacroInstance_0"
MacroGraphReference=(MacroGraph="/Script/Engine.EdGraph'/Engine/EditorBlueprintResources/ActorMacros.ActorMacros:Switch Has Authority'")
NodePosX=-160
NodePosY=272
NodeGuid=473B6B00493F50173027459CE3741B70
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_0"
bIsPureFunc=True
FunctionReference=(MemberParent="/Script/CoreUObject.Class'/Script/GameplayAbilities.AbilitySystemBlueprintLibrary'",MemberName="GetAbilitySystemComponent")
NodePosX=-160
NodePosY=400
NodeGuid=D54A5D9C4A6C097D5A6C92A0622F3568
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_2"
FunctionReference=(MemberParent="/Script/CoreUObject.Class'/Script/GameplayAbilities.AbilitySystemComponent'",MemberName="BP_ApplyGameplayEffectToSelf")
NodePosX=448
NodePosY=254
NodeGuid=790AC521482AA03EA707BCA5E8ACF4EF
End Object
B_TurretAIController GetTeamAttitude Implementation
Click to expand full BlueprintUE code to copy&paste into UE
Begin Object Class=/Script/BlueprintGraph.K2Node_FunctionEntry Name="K2Node_FunctionEntry_0"
FunctionReference=(MemberParent="/Script/CoreUObject.Class'/Script/AITurret.TurretAIController'",MemberName="GetTeamAttitude")
NodeGuid=A3B829E8409F398E70A9278C7ED41C89
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_CallParentFunction Name="K2Node_CallParentFunction_0"
bIsPureFunc=True
bIsConstFunc=True
FunctionReference=(MemberParent="/Script/CoreUObject.Class'/Script/AITurret.TurretAIController'",MemberName="GetTeamAttitude")
NodePosX=240
NodePosY=80
NodeGuid=D6949BF94958AD47EC745781D05B1D18
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_FunctionResult Name="K2Node_FunctionResult_0"
FunctionReference=(MemberParent="/Script/CoreUObject.Class'/Script/AITurret.TurretAIController'",MemberName="GetTeamAttitude")
NodePosX=512
NodeGuid=9283AF6844D355D5D1D04B87BDAF9272
End Object
Troubleshooting
Common Issues and Solutions
Turrets Not Recognizing Teams
- Problem: Turrets attack friendly players
- Solution: Verify Team IDs match between turrets and players
- Check: Ensure
GetTeamAttitude
function is properly overridden
Damage Not Applied
- Problem: Projectiles hit but don't deal damage
- Solution: Verify
GE_Damage_Turret
is properly configured - Check: Ensure target has a valid Ability System Component
Performance Issues
- Problem: Frame drops with multiple turrets
- Solution: Reduce sight radius and tick frequency
- Optimization: Use LOD system for distant turrets
Networking Problems
- Problem: Turrets behave differently on client vs server
- Solution: Ensure all damage logic runs on server (Authority check)
- Verification: Test in multiplayer environment
Best Practices
- Always use Authority checks for damage dealing
- Test in multiplayer early and often
- Optimize sight ranges based on your map size
- Use consistent team IDs across all actors
- Profile performance with multiple turrets active
Advanced Customization
Custom Damage Types
You can create specialized damage effects for different scenarios (suggestions):
- GE_Damage_Turret_Heavy - High damage, slow rate of fire
- GE_Damage_Turret_Rapid - Low damage, high rate of fire
- GE_Damage_Turret_Explosive - Area damage effects
Team-Specific Behaviors
Implement different turret behaviors per team:
- Defensive turrets - Protect specific areas
- Aggressive turrets - Hunt down enemies
- Support turrets - Provide covering fire
Next Steps
After successful integration:
- Test thoroughly in multiplayer scenarios
- Balance damage values for your game
- Create custom turret variants for different roles
- Integrate with your HUD for turret status display
- Add sound effects and visual feedback
Community Support
Need help with Lyra integration?
- 💬 Join our Discord Server
- 📺 Watch our YouTube Showcase
- 🛒 Get the plugin on Fab Marketplace
This integration showcases the professional-grade compatibility of the AI Turret plugin with Epic's advanced game frameworks.