# Workspace(ロブロックス クラス) > ゲームの世界そのものを表すサービスです。Workspaceの中に入れたパーツやモデルが、ゲームの画面に表示されます。スクリプトからは workspace と書いて使えます。 - URL:https://roblox.minecraft-okinawa.com/reference/classes/Workspace/ - 公式:https://create.roblox.com/docs/reference/engine/classes/Workspace - 受け継いでいるクラス:WorldRoot ## 使用例:光線(レイキャスト)で地面を調べる (Script/置く場所:ServerScriptService) ```lua local origin = Vector3.new(0, 50, 0) local direction = Vector3.new(0, -100, 0) local params = RaycastParams.new() params.FilterType = Enum.RaycastFilterType.Exclude local result = workspace:Raycast(origin, direction, params) if result then print("当たったもの:" .. result.Instance.Name, result.Position) end ``` ## プロパティ - `Workspace.AirDensity: float`:The air density at ground level, used in the aerodynamic force model. - `Workspace.AirTurbulenceIntensity: float`:Controls the strength of turbulence present in the wind velocity field, affecting the aerodynamic force model. - `Workspace.AllowThirdPartySales: boolean`:Determines whether assets created by other users can be sold in the game. - `Workspace.AuthorityMode: AuthorityMode`:Sets the server authority mode. - `Workspace.AvatarUnificationMode: AvatarUnificationMode`:Enables the R6 to R15 adapter, allowing R15 avatars to join R6 experiences. - `Workspace.ClientAnimatorThrottling: ClientAnimatorThrottlingMode`:Specifies the animation throttling mode for the local client. - `Workspace.CurrentCamera: Camera`:今使われているカメラ。 - `Workspace.DistributedGameTime: double`:The amount of time, in seconds, that the game has been running. - `Workspace.EnableSLIMAvatars: RolloutState`:Controls whether SLIM rendering is used for avatars in the experience. - `Workspace.FallenPartsDestroyHeight: float`:Determines the height at which falling Class.BasePart|BaseParts and their ancestor Class.Model|Models are removed from Workspace. - `Workspace.FallHeightEnabled: boolean`:Controls whether parts that fall below Workspace.FallenPartsDestroyHeight are automatically destroyed. - `Workspace.FluidForces: FluidForces`:Determines whether the physics engine computes aerodynamic forces on Class.BasePart|BaseParts whose Class.BasePart.EnableFluidForces|EnableFluidForces property is true. - `Workspace.GlobalWind: Vector3`:Specifies the global wind vector for animated terrain grass, dynamic clouds, and particles. - `Workspace.Gravity: float`:重力の強さ。初期値は196.2です。小さくすると、ふわっと高くジャンプできます。 - `Workspace.IKControlConstraintSupport: IKControlConstraintSupport`:Enables support for constraints for IKControls. If disabled, IKControls ignore physics constraints. - `Workspace.ImprovedPhysicsReplication: RolloutState`:Controls whether the experience uses the improved physics replication path between the server and clients. - `Workspace.InsertPoint: Vector3`:The world position at which new objects are placed when inserted from the toolbox. - `Workspace.LayeredClothingCacheOptimizations: RolloutState`:Controls whether layered clothing cache optimizations are enabled. - `Workspace.LuauTypeCheckMode: LuauTypeCheckMode`:Sets the Luau type checking mode for scripts in the experience. - `Workspace.MeshPartHeadsAndAccessories: MeshPartHeadsAndAccessories`:Sets whether character Heads and Accessories should be downloaded as MeshParts. - `Workspace.MeshStreamingAndImprovedLods: RolloutState`:Controls whether the experience uses the new mesh streaming and improved LOD system. - `Workspace.ModelStreamingBehavior: ModelStreamingBehavior`:Controls how Class.Model|Models are replicated in experiences when instance streaming is enabled. - `Workspace.NextGenerationReplication: RolloutState`:When true, enables an alternate replication system that alters and improves how properties are replicated under the hood. - `Workspace.NextGenerationReplicationAlias: RolloutState`: - `Workspace.PathfindingUseImprovedSearch: PathfindingUseImprovedSearch`:Controls whether an improved search algorithm is used by PathfindingService. - `Workspace.PhysicsSteppingMethod: PhysicsSteppingMethod`:Sets how the solver will advance the physics simulation forward in time. - `Workspace.PlayerCharacterDestroyBehavior: PlayerCharacterDestroyBehavior`:Controls whether the engine automatically calls Destroy() on a player's character when it is replaced and on the Player object when the player leaves. - `Workspace.PlayerScriptsUseInputActionSystemAlias: RolloutState`: - `Workspace.PredictiveStreamingMode: PredictiveStreamingMode`:Controls whether the engine can make predictive streaming decisions. - `Workspace.NextGenerationPhysicsSolver: RolloutState`:Controls whether the experimental next generation physics solver is enabled. - `Workspace.RejectCharacterDeletions: RejectCharacterDeletions`:Controls whether the server rejects attempts by clients to delete player characters from the workspace. - `Workspace.RenderingCacheOptimizations: RenderingCacheOptimizationMode`:Controls whether rendering cache optimizations are enabled. - `Workspace.ReplicateInstanceDestroySetting: ReplicateInstanceDestroySetting`:Controls how Instance:Destroy() calls are replicated from the server to clients. - `Workspace.Retargeting: AnimatorRetargetingMode`:Controls whether animation retargeting is enabled for character animations. - `Workspace.SandboxedInstanceMode: SandboxedInstanceMode`:Controls whether sandboxed instance mode (script capabilities) is enabled. - `Workspace.SignalBehavior: SignalBehavior`:Configures when the engine resumes event handlers. - `Workspace.SignalBehaviorAlias: SignalBehavior`: - `Workspace.StreamingEnabled: boolean`:Whether content streaming is enabled for the place. - `Workspace.StreamingEnabledAlias: boolean`: - `Workspace.StreamingIntegrityMode: StreamingIntegrityMode`:Determines whether streaming integrity mode is active. - `Workspace.StreamingMinRadius: int`:Minimum distance that content will be streamed to players with high priority. - `Workspace.StreamingTargetRadius: int`:Maximum distance that content will be streamed to players. - `Workspace.StreamOutBehavior: StreamOutBehavior`:Configures how the engine decides when to stream content away from players. - `Workspace.Terrain: Terrain`:A reference to the Terrain object parented to the Workspace. - `Workspace.TouchesUseCollisionGroups: boolean`:Determines whether Class.BasePart|parts in different groups set to not collide will ignore collisions and touch events. - `Workspace.UseFixedSimulation: RolloutState`:When true, enables Class.RunService:BindToSimulation() which calls a function at a fixed frequency, updates physics stepping logic, and makes the Global.RobloxGlobals.time() function return the fixed stepped frame time. - `Workspace.UseFixedSimulationAlias: RolloutState`: - `Workspace.UseNewLuauTypeSolver: RolloutState`:Controls whether the new Luau type solver is used for type inference. ## メソッド - `Workspace:ApplyRecommendedStreamingSettings(): boolean`:Applies Roblox's recommended instance streaming settings to the Workspace. - `Workspace:GetNumAwakeParts(): int`:Returns the number of Class.BasePart|BaseParts that are deemed physically active, due to being recently under the influence of physics. - `Workspace:GetPhysicsThrottling(): int`:Returns an integer, between 0 and 100, representing the percentage of real time that physics simulation is currently being throttled to. - `Workspace:GetRealPhysicsFPS(): double`:Returns the number of frames per second that physics is currently being simulated at. - `Workspace:GetServerTimeNow(): double`:Returns the server's Unix time in seconds. - `Workspace:JoinToOutsiders(objects: Instances, jointType: JointCreationMode): ()`:Creates joints between the specified Class.BasePart|Parts and any touching parts depending on the parts' surfaces and the specified joint creation mode. - `Workspace:PGSIsEnabled(): boolean`:Returns true if the game has the PGS Physics solver enabled. - `Workspace:UnjoinFromOutsiders(objects: Instances): ()`:Breaks all joints between the specified Class.BasePart|BaseParts and other Class.BasePart|BaseParts. - `Workspace:ZoomToExtents(): ()`:Positions and zooms the Workspace.CurrentCamera to show the extent of Class.BasePart|BaseParts currently in the Workspace. ## イベント - `Workspace.PersistentLoaded(player: Player)`:Fires when persistent models have been sent to the specified player. 英語の説明とメンバー一覧:Roblox Creator Documentation(CC BY 4.0)。日本語の解説はこのサイト独自のものです。 執筆:鈴木孝昌(現役プロジェクトマネージャー/プログラミング講師)/運営:沖縄マイクラ部 プログラミングスクール「クロスウェーブ」(https://minecraft-okinawa.com/)