Andy Gilbert Posted August 12, 2011 Share Posted August 12, 2011 Hi, im just playing with lua inside the editor and as for a basic example, if i write a script that uses the update function to rotate an object on an axis it will do this instantly regardless if the "game" is running or not, how can i check if the game is running in the editor? Thanks Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
Rick Posted August 12, 2011 Share Posted August 12, 2011 One way to do this is shown in my Pi-Main http://www.leadwerks.com/werkspace/files/file/72-pi-main-v01/ This basically creates a variable in the main script that you can check against in your model scripts. I'm sure there are other ways to do this also. Perhaps checking if fw is nil or not as I seem to recall that variable doesn't get created until the main game script runs? But I do agree it would have been nice if there were 2 separate Updates() that we could work with or something along that line to separate from design mode vs run-time mode. Quote Link to comment Share on other sites More sharing options...
Andy Gilbert Posted August 13, 2011 Author Share Posted August 13, 2011 Thanks Rick, will give that a go. Just thinking ahead, what happens once i press "play" and i have scripted objects to move around? I guess when i press stop they wont return to thier original state? Thanks Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
Rick Posted August 13, 2011 Share Posted August 13, 2011 They should return to their original state once you stop. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.