So I have a pattern made out of cubes and I want to trace from each side to detect if there is another cube nearby, if true then i want to set the value in the map.
I have a Map variable with mesh as a Key and my struct as a value for each side.
As I understand if I use Map ADD node and I already have a same key with value it will change the value for that key ?
this is my code at the moment. After looping side check for current mesh I check to see if all sides are true, but some sides are marked wrong.
Am I overwriting the struct booleans somehow with each mesh ?
Another thing I should mention is I try to run it within construction script.
Iâm not sure if trace by channel works there or not cause lines appear and if I uncheck ignore self I get a hit.
And thatâs the reason why my struct bools dont get set cause (except last trace for some reason is always true) trace does not register my spawned static mesh components (I have set collision enabled and visibility channel to block)
Okay thanks for your help, I can try to get location of current mesh and go through array and check actor locations and check if they match my mesh location + vector for each direction and add meshes as adjacent with struct and a map I guess
I got the trace to work, but the struct problem is still there something is overwriting the information cause on set struct member I check the value and draw debug just to confirm if the value in struct is correct.
but at the end all the values are wrong. First I thought that adding value back into map wipes all other bools to default value (false) so I made local var for that map key and carried them over, but that still didinât help.
Is there another way to have array of bools for each mesh ?
Thank you that worked there was the problem with Map âFindâ node giving a copy and then âSet member in STRUCTâ making a ref of that copy, but not actually changing anything yet so I still had to add it back into the map with the current key to actually push the change into the map.
last question thatâs related to output log that I used to debug it I donât understand why it prints out the info 6 times
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Mesh: NODE_AddStaticMeshComponent-0_6
---StartingStructValues---
Forward: false
Right: false
Backward: false
Left: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Forward direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Forward direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Right direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Right direction to: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Backward direction hit result is: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Backward direction to: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Left direction hit result is: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Left direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Mesh: NODE_AddStaticMeshComponent-0_6
---ForLoopCompletion Struct Values---
Forward: false
Right: true
Backward: true
Left: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Mesh: NODE_AddStaticMeshComponent-0_6
---StartingStructValues---
Forward: false
Right: false
Backward: false
Left: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Forward direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Set Forward direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Right direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Set Right direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Backward direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Set Backward direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Left direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Set Left direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Mesh: NODE_AddStaticMeshComponent-0_6
---ForLoopCompletion Struct Values---
Forward: false
Right: false
Backward: false
Left: false
LogUObjectHash: Compacting FUObjectHashTables data took 1.83ms
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Mesh: NODE_AddStaticMeshComponent-0_6
---StartingStructValues---
Forward: false
Right: false
Backward: false
Left: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Forward direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Forward direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Right direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Right direction to: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Backward direction hit result is: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Backward direction to: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Left direction hit result is: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Left direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Mesh: NODE_AddStaticMeshComponent-0_6
---ForLoopCompletion Struct Values---
Forward: false
Right: true
Backward: true
Left: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Mesh: NODE_AddStaticMeshComponent-0_6
---StartingStructValues---
Forward: false
Right: false
Backward: false
Left: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Forward direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Set Forward direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Right direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Set Right direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Backward direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Set Backward direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Left direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Set Left direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Mesh: NODE_AddStaticMeshComponent-0_6
---ForLoopCompletion Struct Values---
Forward: false
Right: false
Backward: false
Left: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Mesh: NODE_AddStaticMeshComponent-0_6
---StartingStructValues---
Forward: false
Right: false
Backward: false
Left: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Forward direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Forward direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Right direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Right direction to: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Backward direction hit result is: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Backward direction to: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Left direction hit result is: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Left direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Mesh: NODE_AddStaticMeshComponent-0_6
---ForLoopCompletion Struct Values---
Forward: false
Right: true
Backward: true
Left: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Mesh: NODE_AddStaticMeshComponent-0_6
---StartingStructValues---
Forward: false
Right: false
Backward: false
Left: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Forward direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Set Forward direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Right direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Set Right direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Backward direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Set Backward direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Left direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Set Left direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_1] Mesh: NODE_AddStaticMeshComponent-0_6
---ForLoopCompletion Struct Values---
Forward: false
Right: false
Backward: false
Left: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Mesh: NODE_AddStaticMeshComponent-0_6
---StartingStructValues---
Forward: false
Right: false
Backward: false
Left: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Forward direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Forward direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Right direction hit result is: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Right direction to: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Backward direction hit result is: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Backward direction to: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Left direction hit result is: true
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Set Left direction to: false
LogBlueprintUserMessages: [BP_TEST_Pattern_Rook_C_0] Mesh: NODE_AddStaticMeshComponent-0_6
---ForLoopCompletion Struct Values---
Forward: false
Right: true
Backward: true
Left: false