MoveTo error: The destination is outside the island's play boundaries

Hey! Am moving a prop around in a set area, and am getting this error:

LogVerse: Warning: Devices_move_to_debug_log: MoveTo error: The destination is outside the island’s play boundaries

It’s confusing me a little, because it seems to suddenly occur on props that are within the play boundaries? It triggers on a “rotate in place” MoveTo as well as a “Move to a point within a box” and they’ll seem to freeze up when surrounded by props that are navigating around just fine. Is there a check we can access to see if a position is within bounds? And if so/not, is there a fix that makes sense for somehow checking/clamping the location further? For context, here is the specific code where the issue is happening:

    Wander()<suspends>:void=
        loop:
            Sleep(0.1)
            IdleWaitTime := GetRandomFloat(Data.AIValues.IdleTimeMin,Data.AIValues.IdleTimeMax)
            Sleep(IdleWaitTime)
            Print("Wander begins!")
            if(Data.Prop.IsValid[]):
                Prop := Data.Prop
                WorldWanderPosition := GetValidMoveLocation(CurPosition)
                WanderDist := Distance(CurPosition,WorldWanderPosition)
                NewRotation := GetLookAtRotation(CurPosition,WorldWanderPosition)
                if(Data.Prop.IsValid[]):
                    Print("Begin Wander Rotate Race")
                    Print("Letter Cur Position: X = " + ToString(CurPosition.X) + " Y = " + ToString(CurPosition.Y) + " Z = " + ToString(CurPosition.Z))
                    Prop.MoveTo(CurPosition,NewRotation,Data.AIValues.RotationSpeed)
                MoveTime := WanderDist/Data.AIValues.MoveSpeed
                if(Data.Prop.IsValid[]):
                    Print("Begin Wander Move Race")
                    Print("Letter Wander: X = " + ToString(WorldWanderPosition.X) + " Y = " + ToString(WorldWanderPosition.Y) + " Z = " + ToString(WorldWanderPosition.Z))
                    race:
                       Prop.MoveTo(WorldWanderPosition,NewRotation,MoveTime)
                       CheckObstructionWander()

Snipper of code from GetValidMoveLocation() that determines the location

            WanderDist := GetRandomFloat(Data.AIValues.WanderRangeMin,Data.AIValues.WanderRangeMax)
            WanderAngle := GetRandomFloat(-180.0,180.0)
            WanderPosition := vector3{X:=WanderDist * Cos(WanderAngle),Y:= WanderDist * Sin(WanderAngle)}
            WorldWanderPosition := PropLocation + WanderPosition

The area is very wide (14500x20000) so maybe the large number is throwing things off?

EDIT:

Have been doing more testing, and it seems like even if I have the letter move to it’s current position (not even generating a new location), which it was TeleportTo’d to or MoveTo’d to, it’ll still sometimes throw this error.

Example of the debug output - with other values larger than the error-causing values being shown:

Resolved Issue:

There was a function I was calling that was teleporting the letter to their initial location presumably at around the same time as the MoveTo was being triggered, and it seems to have been throwing off the numbers. Removing unnecessary calls to that function seems to have fixed the issue. Wew!

2 Likes

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