Quote:
Originally Posted by manthan98
Yes i realized that as well... Do u have any idea on how i can incorporate the timer properly so that it runs smooth and doesnt crash...
|
I did not have it crash, but did not do any kind of exhaustive testing either.
Two things to make it go faster:
- Make another While the world is running event and put the 3D Text2.time method there. (Mr. Moke's Suggestion.)
- Where possible, nest your if statements.
By nesting your if statements you only look at the next condition if the first one fails. So rather than:
Code:
if right then
do this
else
Do Nothing
if left then
do that
else
Do Nothing
You have:
Code:
if right then
do this
else
if left then
do that
else
Do Nothing
Note that you can use the pattern above to merge right and left or forward and back or ... but you cannot use it to combine right, left, forward, and back. Can you see why?
While this trick did seem to speed up the movie a good deal, I have no idea why it worked in this case. My confusion lies in the fact that, in this movie, most of the time the answer to the if statements will be false (we are not out of bounds) so all the conditions will be checked anyway and none of them will execute the "then" part.)
Situations like this in I typically group under the acronym MES (Magical Electrical Stuff.) To make it sound like I know what I am talking about