When I have a variable reference like var test : Transform
from a script in a prefab is there something i need to drag onto the variable reference in the script component in the inspector? The asset click at the far right brings up an empty window.
I broke a prefab and now the ‘var test : transform’ doesn’t hook onto anything and at runtime I get :
Setting the parent of a transform which resides in a prefab is disabled
to prevent data corruption.
UnityEngine.Transform:set_parent(Transform)
opponentmove:FixedUpdate() (at
Assets/js_code/opponentmove.js:26)
and
MissingComponentException: There is no
‘Rigidbody’ attached to the “cueb”
game object, but a script is trying to
access it. You probably need to add a
Rigidbody to the game object “cueb”.
Or your script needs to check if the
component is attached before using it.
UnityEngine.Rigidbody.AddRelativeForce
(Vector3 force) (at
C:/BuildAgent/work/842f9557127e852/Runtime/ExportGenerated/Editor/NewDynamics.cs:503)
opponentmove.FixedUpdate () (at
Assets/js_code/opponentmove.js:27)
I have a prefab that is similar and can only see the difference in the inspector like mentioned above.
TIA.