WorldModel
The WorldModel provides some physics features to a ViewportFrame.
More specifically, you can make a WorldModel a child of a ViewportFrame, and then parent geometry to the WorldModel. This will then allow you to use raycasts in the ViewportFrame through the WorldModel. Furthermore you can put Humanoid characters in the WorldModel and their joints will be set-up correctly, and you can animate them.
Summary
Properties
Properties inherited from Model- read parallel
Sets the level of detail on the model for experiences with instance streaming enabled.
- read parallel
Controls the model streaming behavior on Models when instance streaming is enabled.
- read parallel
Points to the primary part of the Model.
Editor-only property used to scale the model around its pivot. Setting this property will move the scale as though Model/ScaleTo was called on it.
- not replicatedread parallel
Determines where the pivot of a Model which does not have a set Model.PrimaryPart is located.
- not replicatednot scriptableread parallel
Methods
Methods inherited from WorldRootReturns true if any of the given BasePart are touching any other parts.
- write parallel
Casts a block shape in a given direction and returns a RaycastResult if the shape hits a BasePart or Terrain cell.
- write parallel
Returns an array of parts whose bounding boxes overlap a given box.
- write parallel
Returns an array of parts whose bounding boxes overlap a given sphere.
- write parallel
Returns an array of parts whose occupied space is shared with the given part.
Moves the specified part to the specified location via inverse kinematics rather than moving it there directly, to ensure any joints, constraints, or collisions that part is participating in remain physically satisfied.
- write parallel
Casts a ray using an origin, direction, and optional RaycastParams, then returns a RaycastResult if an eligible object or terrain intersects the ray.
- write parallel
Casts a spherical shape in a given direction and returns a RaycastResult if the shape hits a BasePart or Terrain cell.
Sets this model to be persistent for the specified player. Model.ModelStreamingMode must be set to PersistentPerPlayer for behavior to be changed as a result of addition.
Returns a description of a volume that contains all parts of a Model.
Returns the size of the smallest bounding box that contains all of the BaseParts in the Model, aligned with the Model.PrimaryPart if it is set.
Returns all the Player objects that this model object is persistent for. Behavior varies based on whether this method is called from a Script or a LocalScript.
Returns the canonical scale of the model, which defaults to 1 for newly created models and will change as it is scaled via Model/ScaleTo.
Moves the PrimaryPart to the given position. If a primary part has not been specified, the root part of the model will be used.
Makes this model no longer persistent for specified player. Model.ModelStreamingMode must be set to PersistentPerPlayer for behavior to be changed as a result of removal.
Sets the scale factor of the model, adjusting the sizing and location of all descendant Instances such that they have that scale factor relative to their initial sizes and locations when scale factor was 1.
Shifts a Model by the given Vector3 offset, preserving the model's orientation. If another BasePart or Terrain already exists at the new position then the Model will overlap said object.
Gets the pivot of a PVInstance.
Transforms the PVInstance along with all of its descendant PVInstances such that the pivot is now located at the specified CFrame.