- Home /
GetComponent of type UnityScript from Boo Script
How can i make boo play nicely with my UnityScripts? Mainly, the use of AddComponent/GetComponent and transferring of values.
Drag.js
public var size:float;
//Lots of other code
Foo.boo
//This is where i need to add/store my Drag script
drag=other.gameObject.AddComponent("Drag")
//Here is where the error gets thrown
//since size is not a member of UnityEngine.Component
drag.size=size
I know its a casting problem, but im not sure how to cast as type Drag or if thats even possible from Boo to UnityScript / UnityScript to Boo. Any help is appreciated, just started typing boo.
Answer by Bunny83 · Jun 04, 2012 at 10:24 AM
It's the exact same problem with UnityScript and C#. If you want to access a class from another language, the class need to be compiled first. You have to place the UnityScript file in another compiling-group, for example: "Standard Assets".
Each language is compiled seperated, but you can use things from other languages if they are already compiled when your script that is using those things is compiled.
@Bunny83 Too funny, i read the top section of the compiling-goups page while looking for an answer :P Thanks! Thats a super cool thing to know.
Your answer

Follow this Question
Related Questions
Shared variable problem, between scripts, help? 1 Answer
Copy collider Component type and parameter to a new Object at runtime 0 Answers
Adding Arbitrary Properties to GameObjects 1 Answer
How to get a component from an object and add it to another? (Copy components at runtime) 12 Answers
Get object, which is more optimized? 1 Answer