Getting an attachments world position

I don’t know if I named this correctly but,
I have 2 attachments inside a part which is inside a model
I am trying to shoot a raycast between the 2 but because their position is relative to it’s parent (0, 1, 0) the raycast is shot at that spot instead of where the attachment is

How can I make this relative to world instead of its parent?

Script
local rayStart = Vector3.FromNormalId(weapon.Handle.Blade.Start.Position);
	local rayCastEnd = Vector3.FromNormalId(weapon.Handle.Blade.End.Position);

	local rayParam = RaycastParams.new();
	rayParam.FilterDescendantsInstances = {player.Character, weapon};
	rayParam.FilterType = Enum.RaycastFilterType.Blacklist;
	
	local NewRay = Ray.new(rayStart, rayCastEnd);
	local rayResult = workspace:Raycast(rayStart, rayCastEnd, rayParam);
	
	if rayResult then
		print(rayResult.Instance:GetFullName());
	end;

You can use CFrame:ToWorldSpace() of the part’s cframe.

Raycasts only use Vector3
[ character limit ]

You can just get the position value of the resulting cframe

Oh. I did not know that lol, sorry I don’t usually use cframe or raycasts. Thank you

I know this is solved but you can also use attachment.WorldPosition or attachment.WorldCFrame

5 Likes

Nevermind, didn’t work still didn’t use the spot the attachment is at