- Home /
C# to Unityscript problem.
Hi all,
I have this code that is currently driving me nuts.
C#
// Update is called once per frame
new void Update ()
{
// call inherited JigsawPuzzle.Update();
base.Update();
}
I have tried to convert it to:
Unityscript.
// Update is called once per frame
function Update ()
{
// call inherited JigsawPuzzle.Update();
base.Update();
}
And i get an Unknown identifier: 'base'. error.
There is no variable 'base' in the C# script at all.
Also the line //Call inherited JigsawPuzzle.Update(); Does that mean that i need to access the Update function from my JigsawPuzzle script?
How would i go about doing that? gameObject.GetComponent?
Any help would be appreciated. :)
Thanks.
Daniel.
Answer by Bunny83 · Aug 05, 2011 at 05:52 PM
Well, "base" is called "super" in Unityscript.
See this page for more information:
http://www.unifycommunity.com/wiki/index.php?title=Head_First_into_Unity_with_UnityScript#Virtual_functions_can_be_used_to_override_functions
Thanks for that, and thanks for the link.. more info for me to learn. :)
Your answer
![](https://koobas.hobune.stream/wayback/20220612171257im_/https://answers.unity.com/themes/thub/images/avi.jpg)