Home > other >  Unity4.0 a few words of JS script, cannot run in Unity5.0, beg god to change.
Unity4.0 a few words of JS script, cannot run in Unity5.0, beg god to change.

Time:09-19


As shown in figure, is the code of the video above, not on my Unity5.0 above the version of the run, the red code to find the Main Camera Camera, obtaining the above sheji. Js script sdshu on a variable's value, could you tell me how to modify?? Grows a new struggle may not be the solution, have a day, hope leaders help see,

CodePudding user response:

Your Main Camera the Main Camera name didn't change

CodePudding user response:

I use test 5.5.4 version, no gameobject. Find methods, suggest using Camera. The main direct access to the main Camera

CodePudding user response:

refer to the second floor xiaoruanzhu response:
I use test 5.5.4 version, no gameobject. Find methods, suggest using Camera. The main direct access to the main Camera
other scripts gameobject. But I find no problem, the problem should be out on the Getcomponent statement, really want to get less than the variables in the script, bosses help have a look

CodePudding user response:

Don't work don't quite understand what specific refers to, compile error, or no UI does not appear to the text? If no want content, look at the judgment conditions meet no,
If you want to learn Unity, suggest to switch to the c #, after the 2017 version of Unity to abandon the support js, only support c #,

CodePudding user response:

It is ok to use js stars, otherwise your code has been an error, can't run

CodePudding user response:

reference 5 floor u011017980 reply:
it is ok to use js stars, otherwise your code has been an error, can't run
what is the stars

CodePudding user response:

Generics, got the wrong number

CodePudding user response:

Direct public reference is not a simple
?
  • Related