Hi, I’m working on a Hitbox system of my own and am looking to advance it. Currently, it works fine by using the green example below: It creates a Ray between the Top & Bottom attachment. However, I’m attempting to further this using the Red example, in all corners - Therefore creating four Rays as opposed to the one.
Now, I know how I can do this using Attachments themselves, however I’m looking to remove the use of Attachments themselves and get the required information solely using the Size of the Part.
This is currently how it functions:
local Origin = Tool["HitBox"]["AT0"].WorldPosition
local Direction1 = Tool["HitBox"]["AT1"].WorldPosition
local Direction2 = (Origin - Direction1).Unit * 2
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {Player.Character}
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
local raycastResult = workspace:Raycast(Origin, Direction2 * ((Origin - Direction1).Magnitude), raycastParams)