Use MoveTo to move multiple props at the same time

I want to use moveto for every prop in an array and make the props move at the same time.

    ShowTycoonFloors()<suspends>:void=
        #Get floor props from tag
        TaggedFloors := GetCreativeObjectsWithTag(ground_floor_floor_tag{})
        for (FloorProp:TaggedFloors):
            #Convert floors to creative_props
            if (FloorCProp := creative_prop[FloorProp]):
                #Get base position of floor
                FloorPos := FloorCProp.GetTransform().Translation
                #Make the floor start off in the air
                FloorCProp.MoveTo(vector3{X:=FloorPos.X, Y:=FloorPos.Y, Z:=FloorPos.Z + 150.0}, rotation{}, 0.01) 
                #show the floor
                FloorCProp.Show()
                FloorCProp.MoveTo(vector3{X:=FloorPos.X, Y:=FloorPos.Y, Z:=FloorPos.Z}, rotation{}, 0.1) # I want this moveto to run for all props at the same time
             

You can just write a function that moves a prop that takes a prop, loc, and rot as params and spawn it during the loop and they should all move pretty much at the same time

ShowTycoonFloors()<suspends>:void=
        #Get floor props from tag
        TaggedFloors := GetCreativeObjectsWithTag(ground_floor_floor_tag{})
        for (FloorProp:TaggedFloors):
            #Convert floors to creative_props
            if (FloorCProp := creative_prop[FloorProp]):
                #Get base position of floor
                FloorPos := FloorCProp.GetTransform().Translation
                #Make the floor start off in the air
                FloorCProp.MoveTo(vector3{X:=FloorPos.X, Y:=FloorPos.Y, Z:=FloorPos.Z + 150.0}, rotation{}, 0.01) 
                #show the floor
                FloorCProp.Show()
                Loc : vector3 = vector3:
                    X := FloorPos.X
                    Y := FloorPos.Y
                    Z := FloorPos.Z
                spawn:
                    Move_A_Prop(FloorCProp, Loc, rotation{})

Move_A_Prop(Prop:creative_prop, Loc:vector3, Rot:rotation)<suspends>:void=
    Prop.MoveTo(Loc, Rot, 0.1)

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