Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Set the selected slot:
Set Selected Slot Slot Index = X
Get Selected Slot → int32
Is Slot Selected Slot Index = X Return = true/false
HotbarComponent->SetSelectedSlot(DesiredIndex); int32 Selected = HotbarComponent->GetSelectedSlot(); bool bSelected = HotbarComponent->IsSlotSelected(SomeIndex);
Event On Slot Selection Changed New Selected Slot = Index ↓ Update UI highlight ↓ Optionally: Equip weapon / update action
HotbarComponent->OnSlotSelectionChanged.AddDynamic(this, &AMyClass::HandleSelectionChanged); void AMyClass::HandleSelectionChanged(int32 NewSlot) { // Example: update UI and/or equip HotbarUI->HighlightSlot(NewSlot); }
void AMyCharacter::ScrollHotbar(float Delta) { int32 CurrentSlot = HotbarComponent->GetSelectedSlot(); int32 MaxSlots = HotbarComponent->MaxSlots; int32 NewSlot = CurrentSlot; if (Delta > 0) { NewSlot = (CurrentSlot + 1) % MaxSlots; } else if (Delta < 0) { NewSlot = (CurrentSlot - 1 + MaxSlots) % MaxSlots; } HotbarComponent->SetSelectedSlot(NewSlot); }
Get Selected Slot ↓ Add/Subtract (based on scroll input) ↓ Modulo by MaxSlots ↓ Set Selected Slot