Troubleshooting
Common issues and how to resolve them.
Units Not Selectable
Problem: Can't click on units to select them.
Solutions:
- Ensure
SelectableComponentis added to unit - Check collision layers/masks for raycast compatibility
- Verify
RTS_PlayerInputis enabled - Check that input event handling isn't blocked elsewhere
# Debug: Check if component exists
if not unit.has_node("SelectableComponent"):
print("Unit missing SelectableComponent!")
Units Not Moving
Problem: Move commands don't result in unit movement.
Solutions:
- Add
MovableComponentto unit - Verify
NavigationRegion3Dwith NavMesh exists in scene - Bake the NavMesh
- Check collision layers for path validation
NavMesh Not Working
Problem: Pathfinding doesn't work or units get stuck.
Solutions:
- Open Scene menu → Bake NavMesh
- Ensure static obstacles are set properly
- Verify cell/agent sizes are appropriate
- Check that terrain is included in NavMesh
Events Not Firing
Problem: Signal connections don't work.
Solutions:
- Verify correct signal name (case-sensitive)
- Ensure callback function exists
- Check autoloads are enabled in Project Settings
- Use
get_tree().debug_connectionsto inspectgs
Performance Issues
Problem: Game runs slowly with many units.
Solutions:
- Use spatial hashing for queries (see Spatial Hashing)
- Reduce update frequency for non-critical systems
- Use object pooling for projectiles/effects
- Profile with Godot's profiler
Remark:
On modern hardware, the game should run well with up to 100 units. Consider simplifying the complexity or geometry of units if using more than that. Since Gdscript is not a perfomant language and the logic being completely writtin in gdscript, don't expect to handle multiple hundreds of units at the same time.
Animation Not Playing
Problem: Unit animations don't trigger.
Solutions:
- Ensure AnimationPlayer and AnimationTree are properly set up
- Verify animation names match exactly
- Check AnimationTree parameters are set correctly
- Enable AnimationTree with
anim_tree.active = true - Be aware that an active AnimationTree overwrites the AnimationPlayer!
Health/Damage Not Working
Problem: Health doesn't decrease when taking damage.
Solutions:
- Add
HealthComponentto unit - Verify damage is actually being applied
- Check if unit has defense that might block damage
- Inspect health events to unit
Autoload Not Found
Problem: RTS_EventBus, RTSController, or RTS_PlayerInput errors.
Solutions:
- Check plugin is enabled (Project → Settings → Plugins)
- Reload project if adding plugin
- Verify autoload names in Project Settings → Autoload
- Check for script errors in console Settings → Plugins)
- Try manually adding the autoloads
Collision Issues
Problem: Units pass through each other or obstacles.
Solutions:
- Configure collision layers properly, by checking rts_settings.tres
- Use appropriate collision shapes (not too small)
- Check collision layer/mask combinations
Remark:
Collision layers for RTS_Entity and RTS_Component should automatically be set in _ready depending on the Faction of the Entity.
Getting Help
If you're stuck:
- Check the Best Practices guide
- Review relevant documentation section
- Check the examples in the addon
- Enable debug output and check console
- Use Godot's debugger to inspect state
See Also
- Getting Started - Initial setup
- Best Practices - Common patterns
- Core Concepts - How things work