Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Invoke(methodName: string, time: float): void;

Description

Invokes the method methodName in time seconds.

	// Launches a projectile in 2 seconds

var projectile : Rigidbody;

Invoke("LaunchProjectile", 2);

function LaunchProjectile () { var instance : Rigidbody = Instantiate(projectile); instance.velocity = Random.insideUnitSphere * 5; }