I understand the basics on how to use returns, however, i don't understand how it can be implemented into making a game. Feel free to use examples to make your answer more comprehensible.
Thank you :)
I understand the basics on how to use returns, however, i don't understand how it can be implemented into making a game. Feel free to use examples to make your answer more comprehensible.
Thank you :)
If you want a separate function in a script that you're likely to use many times then return is quite useful so you will save space.
It is also used for ModuleScripts since when you use a variable to require them, you will get a returned value too through return module.
I couldn't think of a good example but I hope this helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
There are many examples of ways to use return. Asking how something so small can be used to create a game is too broad and opinion based.