Game Development Reference
In-Depth Information
Classified intel
In this section, we used the
Instantiate()
function to clone a new game object from
the
prefab
object in the
Project
view. The
Instantiate()
function takes three para-
meters, which are the original
Object
,
Position (Vector3)
, and
Rotation
(Quaternion)
. The
Position
and
Rotation
objects are the transform parameters
at the start position of the object, which will be created in the scene. The
Instanti-
ate()
function can take any kind of object, and the result can also be returned to any kind
of object. We can also see more examples and details from the Unity document at the fol-
lowing links:
Next, we will talk about the
Invoke()
function, which we used to call the function after
the time we have set in seconds. If some of you have experience with ActionScript or
JavaScript, this function is very similar to the
setTimeOut()
function. We can also use
InvokeRepeating()
to call a method similar to the
Invoke()
function, but this
function will repeat calling that function every time we set the time in seconds. We can see
more details of the
Invoke()
function from the Unity document at the following website:
To know more about the
InvokeRepeating()
function, refer to the following website: