# \[Verse\] Struct losing information on instantiation?

**URL:** <https://forums.unrealengine.com/t/verse-struct-losing-information-on-instantiation/1641156>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [January 25, 2024, 10:15am UTC](https://forums.unrealengine.com/t/verse-struct-losing-information-on-instantiation/1641156 "2024-01-25T10:15:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![atanknomore](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@atanknomore](https://forums.unrealengine.com/u/atanknomore)\
**Post date:** [January 25, 2024, 10:15am UTC](https://forums.unrealengine.com/t/verse-struct-losing-information-on-instantiation/1641156/1 "2024-01-25T10:15:35Z")

</div>

any clues as to what might be the cause?

```auto
                InPropTransform := AsProp.GetTransform()

                Print("Found new Movement Struct for index {Index} with Starting {InPropTransform.Translation }")

                var InitialRotation : rotation = InPropTransform.Rotation
                var Location : vector3 = InPropTransform.Translation

                set Location = Location + (InitialRotation.GetLocalForward() * Prop.MoveInDirectionAmount.X) 
                       + (InitialRotation.GetLocalRight() * Prop.MoveInDirectionAmount.Y)
                       + (InitialRotation.GetLocalUp() * Prop.MoveInDirectionAmount.Z)

                InPropTargetTransform := transform{Scale := InPropTransform.Scale, Rotation := InitialRotation, Translation := Location}

                Print("Processed new Movement Struct for index {Index} with Starting {InPropTargetTransform.Translation }")

                set bResult = true
                var NewItem : prop_transform_struct = prop_transform_struct {
                            bIsTransformActive := true,
                            InitialTransform := InPropTransform, 
                            TargetTransform := InPropTargetTransform, 
                            ChildIndexArray := Index
                            NumberOfLoops := 0
                        } 
                set TransformArray = TransformArray + array { NewItem }

                Print("Adding new Movement Struct for index {Index} with Starting {NewItem.InitialTransform.Translation }, Target {NewItem.TargetTransform.Translation}")
            else:
                Print("Index {Index} could not get added. Prop is probably not valid")

```

when NewItem gets constructed, both transforms are zeroed even though they’re both valid inputs

I’m doing these struct constructions with this struct in multiple places and observing similar behavior (data doesn’t make it through)… is there something important I’m missing here?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/b/0/2b038c16a34e59a2819447bc25a2a4014e05eeae.jpeg)

---

<div class="post-metadata">

**Author:** ![atanknomore](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@atanknomore](https://forums.unrealengine.com/u/atanknomore)\
**Post date:** [January 25, 2024, 10:18am UTC](https://forums.unrealengine.com/t/verse-struct-losing-information-on-instantiation/1641156/2 "2024-01-25T10:18:31Z")

</div>

For more information, I have two interacting structs,

transform\_device\_base has an array (non editable) of prop\_transform\_struct{}, which stores the basic data of each transform entry.

transform\_linearlocation\_device has an array (editable) of prop\_transform\_linearlocation\_struct{} which interact via structure of array model.

so they interact in

```auto
if (TransformItem := TransformArray[Index], LinearItem := LinearArray[Index]):
   DoStuff()

```

LinearArray is defaults only - it’s the transform array that I’m updating constantly whenever things start/stop/wait for movement

---

<div class="post-metadata">

**Author:** ![atanknomore](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@atanknomore](https://forums.unrealengine.com/u/atanknomore)\
**Post date:** [January 25, 2024, 11:22am UTC](https://forums.unrealengine.com/t/verse-struct-losing-information-on-instantiation/1641156/3 "2024-01-25T11:22:38Z")

</div>

the answer is simple, though not exactly obvious.

Two things were going on:

- Items were not being initialized in order
- Not all items were being initialized

Once I fixed those two aspects, all data made it through.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [February 24, 2024, 11:23am UTC](https://forums.unrealengine.com/t/verse-struct-losing-information-on-instantiation/1641156/4 "2024-02-24T11:23:11Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
