Skip to content

A3D_SetWorld

imshooter edited this page Oct 18, 2026 · 2 revisions

Move a physics object, a static object or a zone to another virtual world.

native bool:A3D_SetWorld(Physic:physicid, worldid);

Parameters

Parameter Description
Physic:physicid Physics object to move.
worldid Virtual world, or -1 for every world.

Returns

  • true when it was moved.
  • false when physicid is not a physics object.

Remarks

An object of one world collides with the bodies of that world and with those of every world, -1. The map belongs to every world but the ones a map object was removed in with A3D_RemoveBuilding. Queries see an object when they look in its world or in every world.

The world decides collisions only. The global object the component creates shows in every world. To show an object in one world, give it a streamer object of that world with A3D_AttachDynamicObject.

A moving object wakes up when its world changes.

Example

stock MoveBallToPlayerWorld(Physic:ball, playerid) {
    A3D_SetWorld(ball, GetPlayerVirtualWorld(playerid));
}

Related

  • A3D_GetWorld: The virtual world of a physics object.
  • A3D_AttachDynamicObject: Show a moving physics object with a streamer object instead of a global object.
  • A3D_CreateObject: Create a moving physics object shaped like the collision of a model, or as models.json describes the model.

Home

Guides

Reference

Functions

Creating objects
Motion
Placement
Behaviour
Display and data
Rays
Shapes
Players, vehicles and actors
Map probes
Screen
Map objects
Water
Models and surfaces
Rotations and offsets
Vehicles
Routes
Route display
Walking
Callbacks

Clone this wiki locally