i have an array of texts that’s set to instance editable.
each time that I create a new array element I want to also create other variables such as a float, an AnimMontage var, and a sound wave which must be a children of their parent text array.
EDIT: My bad, I noticed too late that this was filed under Blueprint Scripting. Can you still make sense of it?
You can’t create new variables in a way you seem to be wanting to. If I understand correctly, the best thing you can do is change that array of texts to an array of structs that contain those variables. Something like this:
USTRUCT(BlueprintType)
struct FMyDialogueStruct // this sounds like it's for a dialogue system
{
UPROPERTY(EditAnywhere)
FText Text;
UPROPERTY(EditAnywhere)
UAnimMontage* Montage;
...
};
Then, in your class you replace the text array with this:
the duration is the amount of time the text will appear before being overwritten. the delay was working fine before I added the struct, I guess the inner for loop is breaking stuff somehow
You could try creating a float variable “Time” that accumulate delta time:
if isPrinting → if Time > Duration, add next char to widget & Time = 0 → if Printed char.length == dialogue.length, break loop with isPrinting = false.
this way you can reset and retrigger without the problem of having a pending delay. Downside is you’ll need to tick, but you can set tick enabled when using the dialogue and disable when done. So no biggie.