Placement Orientation Align

How do I make an Auto Align for my placement system? Where the orientation changes based on where it is being set.

Video example (Game name: Anomic):

1 Like

After messing around for some time, I think I figured out the solution.

RayParams.FilterDescendantsInstances = FilterTable
RayParams.FilterType = Enum.RaycastFilterType.Exclude

local RaycastResult = workspace:Raycast(MouseRay.Origin, MouseRay.Direction * MouseDistanceThreshold, RayParams)
if RaycastResult then
	local TargetPos = FixClip(Object.PrimaryPart, RaycastResult)
	local FixCFrameNormal = CFrame.new(TargetPos) * TargetNormal

	Object:PivotTo(CFrame.new(TargetPos, FixCFrameNormal.Position))
end

Note that due it is using look vector, then whatever is the front of the hitbox will be the β€œTop”

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.