Mapped Structures, Set members wont work

Is there any way to make “Set members” node worked with a mapped Struct?
The mapped struct only updates its variables when “ADD” node is used.
I am also using nested structs. Making the workaround very messy and complicated.

Any idea how to make Set members work with mapped structs?

Thanks a lot!

find is returning a copy you need to get a Ref

what you can do is break the map into Keys/Values

Loop over the Keys and check if the Key == your Target, if so return the index, then use the index on the values to GetByRef

Thanks for your reply Auran13,

That makes sense! I understand why now…

Still im not sure how to implement the solution you described here. Would you mind uploading a screenshot? Thanks

@Auran131 I tried to follow your indications to get a ref like this, but still not working

hmm unless the Values itself is a copy? sorry i’m not in engine right now so i might have been mistaken.

if so you may just have to stick with your second solution.

ive stopped using maps since they cant be replicated but to offer other solutions,

  1. just use 2 arrays, one for keys and one for values
  2. put the key inside the struct so its just an array now

I ended up with your option 2 and it sure did work!
Works fine even with the nested structures.

Heres how I did it if someone else needs it.

Thanks lots @Auran131

just to make that slightly more efficient, put the second loop into a function and return when its true, this will stop the loop early when the Actor is found, you could also use a ForEachLoopWithBreak but i find the function cleaner