Guard Spawner SpawnAt() Function

Has anyone been able to get the new Guard Spawner SpawnAt() function (introduced in the 39.0 update) to work yet?

When I try to use it, I get the error:

This function parameter expects a value of type tuple(vector3,?Rotation:?rotation = …), but this argument is an incompatible value of type tuple(vector3,?rotation)

This is the code that I was trying to run:

    NewPosition : vector3 = vector3{X := 32600.0, Y := -34500.0, Z := 1450.0}

    NewRotation : ?rotation = option{MakeRotationFromYawPitchRollDegrees(90.0, 0.0, 0.0)}

    SpawnedAgent := Guard1.SpawnAt(Position := NewPosition, Rotation := NewRotation)

Any help anyone could provide would be greatly appreciated. :grinning_face:

You were using the UnrealEngine spatial math module, meanwhile the SpawnAt uses the Verse SpatialMath module, Here’s a compilable version of your code

using { /Verse.org/SpatialMath }

Test(Guard1:guard_spawner_device)<suspends>:void=
    NewPosition : vector3 = vector3{Left := 32600.0, Up := -34500.0, Forward := 1450.0}

    NewRotation : ?rotation = option{MakeRotationFromYawPitchRollDegrees(90.0, 0.0, 0.0)}

    SpawnedAgent := Guard1.SpawnAt(NewPosition,?Rotation:=NewRotation)
1 Like

Thank you! I greatly appreciate your timely response. :smile:

1 Like

Happy as always to help when I can <3