Other scripts can't see one script.

I have script called “newgr” attached to player. Other scripts can’t access it with player.GetComponent(newgr), and in reverse, that script cant access other script variables, functions etc.
Error in console: BCE0005: Unknown identifier: ‘newgr’.
Error for reverse: The type or namespace name `componentName’ could not be found. Are you missing a using directive or an assembly reference?

Thank You for the help! Somehow, I'm not able to tag you! I would be posting up a new question! Do check it out, and help if you could! Thanks!

Link to the question: https://answers.unity.com/questions/1741198/is-there-a-way-by-which-we-could-controlmove-cinem.html

1 Answer

1

This way might be a bit tedious and i’m not even sure it will work, but you could try making it a public object

public newgr newgrscript;

then go to the script on your playercontroller and you should see a slot for it. Drag the script onto it. if you want to do this for multiple scripts, you just have to do the same thing with different names. Hope this helps.

Cannot drop script into that slot. But thanks for answer.