Hello,
I want to create a dynamic slate components that are added when i press a button. Thus, i have made this code:
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.AutoWidth()
.VAlign(VAlign_Center)
.Padding(2,2,3,2)
[
SNew(STextBlock)
.Text(FText::FromString(TEXT("Scoring Angle: ")))
]
+ SHorizontalBox::Slot()
.AutoWidth()
.Padding(1,1,3,1)
[
SNew(SNumericEntryBox<int>)
.OnValueChanged_Lambda([this](auto NewValue )
{
if(scoring_angle.Num()>0)
scoring_angle[counter] = NewValue;
})
.Value_Lambda([this]()
{
if(scoring_angle.Num()>0)
return scoring_angle[counter];
return 0;
})
]
+ SHorizontalBox::Slot()
.AutoWidth()
.VAlign(VAlign_Center)
.Padding(1,1,3,1)
[
SNew(STextBlock)
.Text(FText::FromString(TEXT("FinalPrefab: ")))
]
This, creates a Scoring Angle text with a numic value. But i dont know how to have dynamic values in the scoring_angle. I have made an array, but the values are always showing the last index and not the index that I want. Every horizontalbox that it is created, it has the same value. Example in photo: