SETTLEMENT_UI_BRIDGE_FIX.md 2.2 KB

Settlement UI Bridge Fix Guide

Problem Identified

You have two separate GameObjects:

  1. SettlementInteractionManager GameObject - has SettlementInteractionManager + SettlementUIBridge
  2. SettlementInteractionUI GameObject - has UIDocument + SettlementInteractionUI component

The SettlementUIBridge is trying to find SettlementInteractionUI on the same GameObject, but they're on different GameObjects!

Solution: Move SettlementUIBridge

Step 1: Remove SettlementUIBridge from SettlementInteractionManager GameObject

  1. Select the SettlementInteractionManager GameObject in the hierarchy
  2. Find the SettlementUIBridge component
  3. Right-click on it and select Remove Component

Step 2: Add SettlementUIBridge to SettlementInteractionUI GameObject

  1. Select the SettlementInteractionUI GameObject in the hierarchy
  2. Click Add Component
  3. Search for SettlementUIBridge and add it
  4. The component will automatically find the SettlementInteractionUI on the same GameObject

Step 3: Verify Setup

After making this change, when you play the game you should see:

[UIBridge] Connected to SettlementInteractionUI

Step 4: Test Settlement Detection

  1. Move your TeamMarker near a settlement
  2. The UI should now properly show/hide based on proximity
  3. The settlement name should display the actual settlement name instead of "Settlement Name"

Alternative Solution: Move SettlementInteractionUI Component

If you prefer to keep everything on the SettlementInteractionManager GameObject:

  1. Select the SettlementInteractionUI GameObject
  2. Copy the UIDocument component settings (note the UXML file reference)
  3. Copy the SettlementInteractionUI component settings
  4. Delete the SettlementInteractionUI GameObject
  5. On the SettlementInteractionManager GameObject:
    • Add UIDocument component
    • Set the UXML file reference
    • Add SettlementInteractionUI component
    • Configure the component settings

Expected Result

After either fix, you should see:

  • [UIBridge] Connected to SettlementInteractionUI in console
  • Settlement UI shows actual settlement names
  • UI appears/disappears when moving near/away from settlements
  • E key works to enter settlements