- Home /
Instantiate Not Working - Boo Script
I'm not sure whats wrong, as far as I'm concerned I'm using this correctly. In fact, I've copied the instantiate "function" from another script that returns no errors. But when i try to launch, I get stopped by error BCE0023 "No appropriate version of 'Radical.Instantiate' for the Argument list '(UnityEngine.GameObject, UnityEngine.Vector3, UnityEngine.Quaternion)' was found." Here's the script. (I know its in boo, but its fairly similar to C#, I might translate this into C# since this isn't more widely used)
def InstantiatePrefab():
SP = GameObject.Find("SelectedPoint")
PIitem as GameObject= Resources.Load(PowerInventory) //PowerInventory is a predefined string declared within the class
clone as GameObject
clone = (Instantiate(PIitem, LH.transform.position, LH.transform.rotation) as GameObject)
clone.name = "ActivePower"
CurrentNum = PInum //PInum is supposed to keep track of what the current power is
Please and Thank you!
I haven't done any scripting in Boo, but the compiler error mentions Radical.Instantiate
. Is Radical
the name of the class you're working on? $$anonymous$$aybe try specifying a class when calling the function: Object.Instantiate
.
No the class is the name of the $$anonymous$$onobehaviour in question - the name of this script. I thought it might've been a problem with the class, but this line worked fine in another script. I think I have a solution though, but, I'll have to test it.
Answer by ThatOwlGuy · Oct 30, 2013 at 04:48 PM
Found the answer! I think there is a way to do it in amore traditional fashion like in javascript and C#, but, here's what I found which was simpler
def InstantiatePrefab():
SP = GameObject.Find("SelectedPoint")
PIitem as GameObject= Resources.Load(PowerInventory) //PowerInventory is a predefined string declared within the class
instance as GameObject = Instantiate(PIitem, SP.transform.position, SP.transform.rotation
clone.name = "ActivePower"
CurrentNum = PInum