Home > Net >  Unity FPS microgame scripts can't find custom scripts
Unity FPS microgame scripts can't find custom scripts

Time:12-01

I'm using the FPS Microgame base to create a basic game in unity. The version I'm using is 2020.3.01f. I've made sure both scripts use the same namespace. If I make another new script, it can find my script but the ones that come with the microgame can not. I'm trying to reach it by using the following code:

collision.gameObject.GetComponent<MyScript>().RunMyFunction();

I would prefer not to scrap the entire collision system the microgame comes with if possible. Any ideas what the problem might be?

CodePudding user response:

You probably have placed your Collision System files under plugin folder. Unity has a build order system which separates projects from each other. If I recall correctly, you can't reference Plugin folder scripts from Asset scripts since Unity compiles each of them as a different project. See if this link helps.

  • Related