What is "Script Execution Order" exactly?

Hi everyone!

I didn’t quite understand the last minute in this lecture-

  1. Why doesn’t the ball move precisely on the paddle? I understand that the ball and the paddle are on different scripts, but why does it affect the way they move relative to each other?
  2. What are exactly the values ​​Rick changes in the “Script Execution Order” tab?
  3. Why do the changes Rick makes in the “Script Execution Order” solve the problem?

Thank you for your time!
BTW sorry if my English isn’t perfect :slight_smile:

Hi Almog,

Thank you for your questions. :slight_smile:

  1. What do you mean by “Why doesn’t the ball move precisely on the paddle?”?
  2. According to the manual, the values in the “Script Execution Order” list are just values. They determine the order in which the scripts are executed. I assume we use such high values to be able to put another script between two scripts without having to give every item in the list a new number.
  3. Because he wants to have one script always be executed before the other script.

Did this clear it up for you?

  1. I understood this part thanks to your other answers so it’s ok. :slight_smile:
  2. & 3. Oh ok that makes sense. Thanks!

But I still don’t understand why will Rick change the values from this (pic 1):
1
to this (pic 2):
2 ?

And why did he put the ball script before the pedal? Why not the other way around?

BTW
If I have a general question about gamedev.tv’s courses, where can I post it?

That’s a good question. Actually, the order should not matter because there is no relevant dependency. The order would matter if the Ball instance generated values which the Paddle instance needs, so the Paddle instance does not access the Ball instance too early. That’s not the case here, though.

I assume that Rick wanted to show the script execution order, and he probably changed the values to have more “room” in case he wants to add more scripts. It makes sense to start with lower numbers closer to 0 than with high numbers.

Feel free to create a new thread here in the “Ask” subforum as we do not have a general GameDev.tv subforum.

1 Like

Great! Thank you so much!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms