Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
How to add a script to the scene root

psikot
Registered User
Quote
2018-08-08 15:25:42

Hi there,

I'm pretty sure I saw it somewhere but I can't find it now... how can I attach a script to the scene so it runs when the application starts?

Thanks in advance!


dartagnan
Registered User
Quote
2018-08-08 19:31:00

I think you're talking about...

Select Scene, Behavior, Before first drawing do something


psikot
Registered User
Quote
2018-08-09 18:10:35

Nevermind, I found it. I just have to call the script with the same name as the project.

But I have another question: I've seen in the example behaviours that there's a function which runs every frame, called Animate.... but I could not find the "onInit" function. Is there any example of a script with such function?... in other words, where should I put the code that I want to run at the start?

Thanks!


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Int?rnational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact