How to make a less than or equal to sign for CFrame

So I’m trying to create an attack, but I want it to be less than or equal to the CFrame where the event fires from.

—> Local Script <—

local debounce = false
local UIS = game:GetService("UserInputService")
local character = plr.CharacterAdded or plr.CharacterAdded:Wait()

UIS.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.Two then
		if not debounce then
			debounce = true
			script.RemoteEvent:FireServer(plr.Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-23).p)
			wait(1)
			debounce = false
		end
	end
end)```
1 Like

Could you elaborate what you mean?

If I understand you correctly, you could use .magnitude - if you know the magnitude distance between the two points and know the distance at which you want the event to fire. For example:

if (point1.Position - point2.Position).magnitude < 10 then

Right now the RemoteEvent only fires when it’s at the exact CFrame, i’m trying to make it less than or equal to the Cframe for this.

script.RemoteEvent:FireServer(plr.Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-23).p)

A CFrame is a matrix of multiple vectors, you can’t say a CFrame is less than another CFrame because CFrames are not number values.

so then is there another way to make it less than or equal to?

CFrames have 12 values for positional and rotational components, comparing the rotational values wouldn’t make sense, while for positional values you can just compare the vector3 values by checking each axis

i’m confused on what you just said

This might help you figure out how to compare CFrames and how to think about CFrames:

https://devforum.roblox.com/t/how-to-think-about-cframes/11743?u=bhristt