Script works in one level, but after copying it to another it does not work anymore

I created a system with three verse scripts in my test level. It all worked, but after copying and setting the correct values, it does not work in my main level. I’ve redone it four times now since I thought I missed something, but I’m 100% sure it’s not that. Have any of you had this problem, and if so, what was the fix for it?

Are they relying on something that’s in your test level, but not your main level? It’s hard to guess what might be going on with limited info.

I’ve not had an issue like that.

Good news: I found the issue, so that’s a good thing. Here is the code:

    MoveToTargetPoint(TargetPoint : int, Agent : agent)<suspends>:void=
        Print("This print prints correctly", ?Duration:=6.0)
        if(VectorTargetPoint := MovementPoints[TargetPoint], VectorRotationPoint := RotationPoints[TargetPoint]):
            Print("this does not print", ?Duration:=6.0)

Again, this script works fine in my ‘test zone’, but not in the main scene

Where are MovementPoints and VectorRotationPoint defined? If you put an else on that if you may see it print in your main scene, since one of those two lookups are failing.

MovementPoints is an array of vector3 points
and RotationPoints is also an array but of rotation, defined like this.

@editable
    MovementPoints : []vector3 = array{}
@editable 
    RotationPoints :  []rotation = array{}

These are set up in the device like this:

In my test zone it looks like this:

If I have the EXACT same values as the testzone in the main scene it still fails to do the IF statement…

I found out the main scene does not run any IF calculations on vector 3

In my TestScene level I made this line of code:

if (NewVector3 := StartPoint[0]):
    Print("Got the vectorpoint: {NewVector3}")
else:
    Print("ERROR! No Vector found", ?Duration:=6.0)

Result of that:
image

If I run that exact same piece of code in my main level, it results false:

image

What is going on :sob:

I tested making another level, but it also does not work in a new map.

What’s StartPoint (the item you test), I don’t see that in your code?

I would have expected the line to use MovementPoints.

Yeah, I’m sorry. I have 2 vector3 arrays, one is startpoint and one MovementPoints

Using @editable arrays has always been reliable for me, not sure what you’re running into. Though for me they are always props or devices, not just numbers (I leave that in the code).

The problem is that it works in one level but does not in another, even if the vectors are the same:/