Terrainクラス
ひとことで言うと
山・水・草原などの地形を表すクラスです。Workspaceの中に1つだけあり、スクリプトで地形を作ることもできます。
公式の説明(英語):Terrain lets you to create dynamically morphable environments.
クラスの関係
受け継いでいるクラス:Object → Instance → PVInstance → BasePart → Terrain
プロパティ(9)
| 名前と書き方 | 説明 |
|---|---|
DecorationTerrain.Decoration: boolean | Enables or disables terrain decoration. |
GrassLengthTerrain.GrassLength: float | Specifies the length of animated grass. |
MaterialColorsTerrain.MaterialColors: BinaryString | Represents the editor for the **Material Color** feature and cannot be edited by scripts. |
MaxExtentsTerrain.MaxExtents: Region3int16 | Displays the boundaries of the largest possible editable region. |
WaterColorTerrain.WaterColor: Color3 | The tint of Terrain water. |
WaterReflectanceTerrain.WaterReflectance: float | Controls how opaque Terrain water reflections are. |
WaterTransparencyTerrain.WaterTransparency: float | The transparency of Terrain water. |
WaterWaveSizeTerrain.WaterWaveSize: float | Sets the maximum height of Terrain water waves in studs. |
WaterWaveSpeedTerrain.WaterWaveSpeed: float | Sets how many times Terrain water waves will move up and down per minute. |
メソッド(24)
| 名前と書き方 | 説明 |
|---|---|
CellCenterToWorldTerrain:CellCenterToWorld(x: int, y: int, z: int): Vector3 | Returns the world position of the center of the terrain cell. |
CellCornerToWorldTerrain:CellCornerToWorld(x: int, y: int, z: int): Vector3 | Returns the position of the lower-left-forward corner of the grid cell. |
ClearTerrain:Clear(): () | Clears all terrain. |
CopyRegionTerrain:CopyRegion(region: Region3int16): TerrainRegion | Stores a chunk of terrain into a TerrainRegion object so it can be loaded back later. |
CountCellsTerrain:CountCells(): int | Returns the number of non-empty cells in the terrain. |
FillBallTerrain:FillBall(center: Vector3, radius: float, material: Material): () | 球の範囲を、指定した素材の地形で埋めます。Fills a ball of smooth terrain in a given space. |
FillBlockTerrain:FillBlock(cframe: CFrame, size: Vector3, material: Material): () | 直方体の範囲を、指定した素材の地形で埋めます。Fills a block of smooth terrain with a given location, rotation, size, and material. |
FillCylinderTerrain:FillCylinder(cframe: CFrame, height: float, radius: float, material: Material): () | Fills a cylinder of smooth terrain in a given space. |
FillRegionTerrain:FillRegion(region: Region3, resolution: float, material: Material): () | Fills a Region3 space with smooth terrain. |
FillWedgeTerrain:FillWedge(cframe: CFrame, size: Vector3, material: Material): () | Fills a wedge-shaped volume of terrain with the given Material. |
GetMaterialColorTerrain:GetMaterialColor(material: Material): Color3 | Returns current terrain material color for specified terrain material. |
GetMaterialSlotTerrain:GetMaterialSlot(slotIndex: int): Tuple | Returns the base material, MaterialVariant, and color configured for a material slot. |
PasteRegionTerrain:PasteRegion(region: TerrainRegion, corner: Vector3int16, pasteEmptyCells: boolean): () | Applies a chunk of terrain to the Terrain object. |
ReadVoxelChannelsTerrain:ReadVoxelChannels(region: Region3, resolution: float, channelIds: Array): Dictionary | Returns a region of terrain voxel data in table format based on the channel names. |
ReadVoxelsTerrain:ReadVoxels(region: Region3, resolution: float): Tuple | Returns a certain region of smooth terrain in table format. |
ReplaceMaterialTerrain:ReplaceMaterial(region: Region3, resolution: float, sourceMaterial: Material, targetMaterial: Material): () | Replaces the terrain of a material within a region with another material. |
ResetMaterialSlotTerrain:ResetMaterialSlot(slotIndex: int): () | Clears a material slot. |
SetMaterialColorTerrain:SetMaterialColor(material: Material, value: Color3): () | Sets current terrain material color for specified terrain material. |
SetMaterialSlotTerrain:SetMaterialSlot(slotIndex: int, baseMaterial: Material, materialVariant: string, color: Color3): () | Configures a material slot with a base material, an optional MaterialVariant, and a color. |
WorldToCellTerrain:WorldToCell(position: Vector3): Vector3 | Returns the grid cell location that contains the position point. |
WorldToCellPreferEmptyTerrain:WorldToCellPreferEmpty(position: Vector3): Vector3 | Returns the grid cell location that contains the position point, preferring empty grid cells when position is on a grid edge. |
WorldToCellPreferSolidTerrain:WorldToCellPreferSolid(position: Vector3): Vector3 | Returns the grid cell location that contains the point position, preferring non-empty grid cells when position is on a grid edge. |
WriteVoxelChannelsTerrain:WriteVoxelChannels(region: Region3, resolution: float, channels: Dictionary): () | Sets a region of terrain using a dictionary of voxel channel data. |
WriteVoxelsTerrain:WriteVoxels(region: Region3, resolution: float, materials: Array, occupancy: Array): () | Sets a certain region of smooth terrain using table format. |
受け継いでいるメンバー
BasePart から受け継いでいるもの(66)
Anchored・AssemblyAngularVelocity・AssemblyCenterOfMass・AssemblyLinearVelocity・AssemblyMass・AssemblyRootPart・AudioCanCollide・BackSurface・BottomSurface・BrickColor・CanCollide・CanQuery・CanTouch・CastShadow・CenterOfMass・CFrame・CollisionGroup・Color・CurrentPhysicalProperties・CustomPhysicalProperties・EnableFluidForces・ExtentsCFrame・ExtentsSize・FrontSurface・LeftSurface・Locked・Mass・Massless・Material・MaterialVariant・PivotOffset・Reflectance・ResizeableFaces・ResizeIncrement・RightSurface・RootPriority・Rotation・Size・TopSurface・Transparency・AngularAccelerationToTorque・ApplyAngularImpulse・ApplyImpulse・ApplyImpulseAtPosition・BindToCollisionSummaries・CanCollideWith・CanSetNetworkOwnership・GetClosestPointOnSurface・GetConnectedParts・GetJoints・GetMass・GetNetworkOwner・GetNetworkOwnershipAuto・GetNoCollisionConstraints・GetTouchingParts・GetVelocityAtPosition・IntersectAsync・IsGrounded・Resize・SetNetworkOwner・SetNetworkOwnershipAuto・SubtractAsync・TorqueToAngularAcceleration・UnionAsync・Touched・TouchEnded
PVInstance から受け継いでいるもの(4)
Instance から受け継いでいるもの(46)
Archivable・Capabilities・IsInSandbox・Name・Parent・PredictionMode・Sandboxed・AddTag・ClearAllChildren・Clone・Destroy・FindFirstAncestor・FindFirstAncestorOfClass・FindFirstAncestorWhichIsA・FindFirstChild・FindFirstChildOfClass・FindFirstChildWhichIsA・FindFirstDescendant・GetActor・GetAttribute・GetAttributeChangedSignal・GetAttributes・GetChildren・GetDebugId・GetDescendants・GetFullName・GetStyled・GetStyledPropertyChangedSignal・GetTags・HasTag・IsAncestorOf・IsDescendantOf・IsPropertyModified・QueryDescendants・RemoveTag・ResetPropertyToDefault・SetAttribute・WaitForChild・AncestryChanged・AttributeChanged・ChildAdded・ChildRemoved・DescendantAdded・DescendantRemoving・Destroying・StyledPropertiesChanged
Object から受け継いでいるもの(4)
英語の説明とメンバーの一覧は、Roblox Creator Documentation(Terrain)をもとにしています(CC BY 4.0)。日本語の解説は、このサイトで独自に書いたものです。