Forums » Questions and answers »
the difference between avatarcontroller and scene:getelement("AvatarController")
Added by kah yong seow over 1 year ago
Hi guys,
I can't seem to understand the difference between the terms mentioned in the subject. I am two days old to LUA scripting. Thanks a lot. I have seen other things like elementransformer, etc too. Does it apply to only plugins?
Thanks a lot.
Cheers,
Sky
Replies (1)
RE: the difference between avatarcontroller and scene:getelement("AvatarController")
-
Added by Craig Presti over 1 year ago
There are two concepts to be aware of here:
scene:getelement('nameOfElement')
Returns the IMML element instance (or nil) of the element with name nameOfElement
<Plugin Name="MyPlugin" .../> <Script Name="..."> function main(obj, args) myplugin:customfunction() end
In this example, the IMML element that represents the plugin is named MyPlugin. When we get that object back, it has only the standard methods and properties that the IMML Plugin element comes with, ie: Name, Source, etc
To get access to the actual IPluginComponent instance (IPluginComponent is the interface all VastPark plugins must implement) you need to use the name of the plugin as I've shown in the script above.
(1-1/1)