Thread: Parameters
View Single Post
David B
Senior Member
David B's Avatar
Status: Offline
Posts: 1,145
Join Date: Dec 2010
Location: N/A
Default 08-16-2011, 03:18 PM

Originally Posted by simsman2011 View Post
I want to know what can the parameters be used for?.......
Parameters are used with methods. It is impossible to describe the purpose of Parameters without the use of an example, so here goes...

Say that you have created a model of a person (whether you truly modeled it yourself, or used the Person Builder, it doesn't matter), and you want to make a method for the person so that it looks like he is walking. You want to make the method in a manner that allows you to choose how many steps he makes when the method is used in another method. To do this, you have to create a parameter. After creating the parameter, you begin to write the code that makes the person look like he is walking, but when you get to the point when you have to state how many meters you want the person to move forward, and how many steps you want the person to make, you don't put in a number for this, but rather put the variable which you created in there. You can then test to see that the method works by dragging the method you created to get the person to walk into the "my first method" method. Upon dragging the method in, however, unlike most custom-made methods, you will be asked to input the value of the parameters. You can have as many or as few parameters as you want (you don't even have to have any if you don't want!).

I hope this helps!
Reply With Quote