Want to improve the docs? Take a look at scripting-api-data!
Found a bug? jc3mp/bugs is a good place to let us know.
Game Objects (
Props
)
new GameObject(string model, Vector3f position, Vector3f rotation)
var gameobject = new GameObject('glowstick_yellow');
Name | Type | Description |
---|---|---|
position | Vector3f | the GameObject's position in the game world |
rotation | Vector3f | the GameObject's rotation in the game world |
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 |
modelHash | string | read only model hash of the GameObject (TODO: reference to all hashes) |
dimension | number | world dimension of the GameObject. |
Applies a 3d-force to the GameObject
Name | Type | Description |
---|---|---|
direction | Vector3f | force direction |
deltaTime | number | delta time |
var object = new GameObject('glowstick_yellow');
object.ApplyForce(new Vector3f(100, 0, 0), 1);
Destroys the GameObject
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.