I would like to get the mesh of the game object “Cube” from a javascript attached to the game object “Sphere”. I have searched the docs and tried several variations with no luck.
This is the script attached to “sphere”;
var target = GameObject.Find("Cube");
var mesh : Mesh = target.GetComponent(MeshFilter).mesh;
This gets the mesh of “Sphere” (the object the script is attached to), instead of the mesh “Cube”. Not sure what is going on. Can anyone help please?