Documentation

GameObject

Constructible This class can be instantiated from your script. You can find more information on the Constructor below. Auto Destroy To delete an instance of this class, use the `Destroy` function of this class. You can find the function definition below. Custom Properties You can extend instances of this class with your own properties.

Game Objects (Props)

Constructor

GameObject(string model, Vector3f position, Vector3f rotation)

  • model: the model name (not hash!) of the object
  • position: the desired position of the GameObject
  • rotation: optional the desired rotation of the GameObject

Example

var gameobject = new GameObject();

Properties

Name Type Description
model string read only the model name (not hash!) of the object
networkId number read only the network id of this entity. It is not unique across different entities and will be re-assigned once this entity was destroyed
position Vector3f the GameObject's position in the game world
rotation Vector3f the GameObject's rotation in the game world
dimension number world dimension of the GameObject.

Functions

GameObject.ApplyForce(Vector3f direction, number deltaTime)

Applies a 3d-force to the GameObject

Parameter

Name Type Description
direction Vector3f force direction
deltaTime number delta time

Example

var object = new GameObject('glowstick_yellow');
object.ApplyForce(new Vector3f(100, 0, 0), 1);

GameObject.Destroy()

Destroys the GameObject

Stay informed

By becoming the newest member of our growing forums, we and hundreds of other players will always keep you up to date on everything JC3:MP related.