简体   繁体   中英

How can I load a Model from a URL in ShiVa3D?

I'm trying to load a model from a URL, using the code found here

I simply created a game with a single AI script called MainAI and added a state to this.

The loop of the state runs and loads the Model (I can see this happening in the logs).

But when the loading is complete, and the status is '1' the line of code:

this.idle( )

Does not work, an error is returned:

[+ Warning ] {Scripting }AI Runtime error : [State] MainAi.loadObj_onLoop (line 20): attempt to call field 'idle' (a nil value)

Any idea how I can stop the loop from running?

I don't completely understand how States work in ShiVa, but I created an empty state called idle. When my State that loads my model is complete, the idle state takes over which works great.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM