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

**URL:** <https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, fortnite\
**Created:** [March 6, 2025, 10:16pm UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536 "2025-03-06T22:16:15Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![PlsFocus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/plsfocus/32/1090249_2.png) [@PlsFocus](https://forums.unrealengine.com/u/PlsFocus)\
**Post date:** [March 6, 2025, 10:16pm UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536/1 "2025-03-06T22:16:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![btwixer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@btwixer](https://forums.unrealengine.com/u/btwixer)\
**Post date:** [March 7, 2025, 12:21am UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536/2 "2025-03-07T00:21:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PlsFocus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/plsfocus/32/1090249_2.png) [@PlsFocus](https://forums.unrealengine.com/u/PlsFocus)\
**Post date:** [March 7, 2025, 7:05pm UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536/3 "2025-03-07T19:05:11Z")

</div>

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

```auto
    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

---

<div class="post-metadata">

**Author:** ![btwixer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@btwixer](https://forums.unrealengine.com/u/btwixer)\
**Post date:** [March 7, 2025, 7:44pm UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536/4 "2025-03-07T19:44:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PlsFocus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/plsfocus/32/1090249_2.png) [@PlsFocus](https://forums.unrealengine.com/u/PlsFocus)\
**Post date:** [March 8, 2025, 11:40am UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536/5 "2025-03-08T11:40:18Z")

</div>

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

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

```

These are set up in the device like this:

 ![Main Level](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/a/8/aa82859d6205d34c89ea2c69f0d15f961f51ccc1.png)

In my test zone it looks like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/a/9/0a90274496ef7ae8851ecb9edea5cb61bca1ea28.png)

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

---

<div class="post-metadata">

**Author:** ![PlsFocus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/plsfocus/32/1090249_2.png) [@PlsFocus](https://forums.unrealengine.com/u/PlsFocus)\
**Post date:** [March 8, 2025, 12:21pm UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536/6 "2025-03-08T12:21:26Z")

</div>

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:

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

```

Result of that:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/optimized/4X/4/8/c/48cc876fc49550471ccac788c1434b9506af07f1_2_517x25.png)

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

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/4/4749283efc0b029c73e421e7db55ce62b61f08dd.png)

What is going on 😭

---

<div class="post-metadata">

**Author:** ![PlsFocus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/plsfocus/32/1090249_2.png) [@PlsFocus](https://forums.unrealengine.com/u/PlsFocus)\
**Post date:** [March 8, 2025, 1:10pm UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536/7 "2025-03-08T13:10:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![btwixer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@btwixer](https://forums.unrealengine.com/u/btwixer)\
**Post date:** [March 8, 2025, 2:23pm UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536/8 "2025-03-08T14:23:01Z")

</div>

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

I would have expected the line to use MovementPoints.

---

<div class="post-metadata">

**Author:** ![PlsFocus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/plsfocus/32/1090249_2.png) [@PlsFocus](https://forums.unrealengine.com/u/PlsFocus)\
**Post date:** [March 8, 2025, 6:41pm UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536/9 "2025-03-08T18:41:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![btwixer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@btwixer](https://forums.unrealengine.com/u/btwixer)\
**Post date:** [March 8, 2025, 7:15pm UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536/10 "2025-03-08T19:15:23Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![PlsFocus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/plsfocus/32/1090249_2.png) [@PlsFocus](https://forums.unrealengine.com/u/PlsFocus)\
**Post date:** [March 8, 2025, 7:44pm UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536/11 "2025-03-08T19:44:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![PlsFocus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/plsfocus/32/1090249_2.png) [@PlsFocus](https://forums.unrealengine.com/u/PlsFocus)\
**Post date:** [March 30, 2025, 1:05pm UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536/12 "2025-03-30T13:05:06Z")

</div>

In case you were wondering what the issue was, I found out I had not put an `@editable` for my other script devices, so it was an empty device without data, so it had no array to work with. Kind of dumb on my part.

---

<div class="post-metadata">

**Author:** ![btwixer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@btwixer](https://forums.unrealengine.com/u/btwixer)\
**Post date:** [March 30, 2025, 1:54pm UTC](https://forums.unrealengine.com/t/script-works-in-one-level-but-after-copying-it-to-another-it-does-not-work-anymore/2378536/13 "2025-03-30T13:54:15Z")

</div>

Glad you found it!
