# RaycastParams(ロブロックス データ型) > レイキャスト(見えない光線)で、何を調べて何を無視するかを決めるデータ型です。 - URL:https://roblox.minecraft-okinawa.com/reference/datatypes/RaycastParams/ - 公式:https://create.roblox.com/docs/reference/engine/datatypes/RaycastParams ## 使用例:光線(レイキャスト)で地面を調べる (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 ``` ## コンストラクター - `RaycastParams.new()`:Returns a blank RaycastParams. ## プロパティ - `RaycastParams.ExcludeInstances: {Instance}?`:An optional array of instances whose descendants will be excluded from the query. - `RaycastParams.IncludeInstances: {Instance}?`:An optional array of instances whose descendants will be included in the query. - `RaycastParams.IgnoreWater: bool`:Determines whether the water material is considered when raycasting against Terrain. - `RaycastParams.CollisionGroup: string`:The collision group used for the operation. - `RaycastParams.RespectCanCollide: bool`:Determines whether the raycast operation considers a part's Class.BasePart.CanCollide|CanCollide property value over its Class.BasePart.CanQuery|CanQuery value. - `RaycastParams.BruteForceAllSlow: bool`:When enabled, the query will ignore all part collision properties and perform a brute-force check on every part. - `RaycastParams.Margin: number`:Expands the cast shape uniformly in every direction. - `RaycastParams.SizeGradient: number`:Scales the cast shape over the length of the cast, tapering the swept volume. - `RaycastParams.FilterDescendantsInstances: Array`:An array of objects whose descendants are used to filter raycasting candidates. - `RaycastParams.FilterType: RaycastFilterType`:Determines whether the Datatype.RaycastParams.FilterDescendantsInstances|FilterDescendantsInstances array is used as an exclude or include list. ## メソッド - `RaycastParams:AddToFilter(instances: Instance | Array): ()`:Adds the instances provided to Datatype.RaycastParams.FilterDescendantsInstances|FilterDescendantsInstances. 英語の説明とメンバー一覧:Roblox Creator Documentation(CC BY 4.0)。日本語の解説はこのサイト独自のものです。 執筆:鈴木孝昌(現役プロジェクトマネージャー/プログラミング講師)/運営:沖縄マイクラ部 プログラミングスクール「クロスウェーブ」(https://minecraft-okinawa.com/)