WordPosition returing a CFrame?

I’m not sure why this isn’t working, as I’ve directly copied the code from a tutorial-

-- Fire Function
local function Fire(Plr, MousePosition)
	local Origin = StartPoint.WorldPosition
	local Direction = (MousePosition - Origin).Unit
	
	Caster:Fire(Origin,Direction,10)
end

I’m trying to utilize the FastCast module, but I’ve gotten this unexpected error while trying to do so. I receive an error, “Unit is not a Valid member of CFrame” which makes no sense to me since “origin” is a Vector3.

Maybe I missed something, but I can’t seem to fix this. If you can help, it’d be appreciated!

How are you defining MousePosition?

Can you show the whole script?

1 Like

If you’re using Mouse.Hit for MousePosition, Mouse.Hit is a CFrame value. The position can easily be retrieved by doing Mouse.Hit.Position.

2 Likes

oh, I was using just using “Mouse.Hit” instead of “Mouse.Hit.Position” I didn’t even realize that I was using the CFrame…