Scripts Not Updating When Moved

I’ve just completed the Folder Structure segment on the new series of videos in the RPG course. Good stuff. I love organization.

Question: Does anyone else have issues with scripts reverting back to an older version when you move them in the structure?

For instance, I created a “Movement” sub directory inside of my Scripts directory. I moved (what I call) my MoverAgent.cs to that new Movement directory. I navigate to the new directory and see it in there. Awesome! I go back into the top level directory “Scripts” and what’s this? I see MoverAgent.cs! I know it’s an older version as well, because it’s missing some comments I had just added recently in Visual Studio (I can see this in the script preview in the inspector). Visual Studio’s version of course is the most current, however there are red underlines as if there are missing dependencies. All those red lines really mean is that Visual Studio (and Unity!) see two scripts with the same name.

I have feeling this has something to do with either the version of Visual Studio, or Unity or both. I am using Microsoft Visual Studio Community 15.9.7 and Unity 2018.3.5f1.

I’ll update this post if I find out anything else relevant.

Loving the new videos! I had gotten to the Raycasting portion of the old version of this series when my head was about to explode with all the errors that were cropping up. Perfect timing!

Hi Daniel,

This may be a bug in unity and had a duplicate of mover.cs as well.
I’m using studio code not community so i think this might be down to unity itself.

@sampattuzzi any insights?

I think this happens if you move the script and still have it open in VSCode. I might put a warning at 3:11 in the video. Let me know if that clarifies it.

2 Likes

That would be consistent with what happened when it occured for me as it did have deleted on the one that was open at the time.

That sounds about right. It doesn’t happen if I have Visual Studio closed and then go back into it. Definitely worth pointing out, especially since it might freak some people out!

Thanks guys! I appreciate the feedback.

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