Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you easily RayCast a Part?

I am trying to make a blade which summons meteors, The thing is that the meteors summon puddles of fire on impact, but some occasions the puddle will appear in mid-air!

Meteor.Touched:Connect(function(Part)
	if HasBeenTouched == false and not Part.Parent:FindFirstChildOfClass("Humanoid") and Part.Name ~= "ChaosMeteor" and Part.Name ~= "VoidPuddle" then
		HasBeenTouched = true -- to stop puddle overlay
		if Part.Parent:FindFirstChildOfClass("Humanoid") then
			return
		end
		local Puddle = VoidFolder.VoidPuddle:Clone()
		Puddle.Parent = workspace
		Puddle.Position = Meteor.Position + Vector3.new(0,-2,0)  -- i thought this would work as the meteor is 4 studs wide
		Puddle.Pain.Owner.Value = Owner
		Puddle.Formation.Disabled = false
		Puddle.Pain.Disabled = false
		Puddle.Form:Play()
		Meteor:Destroy()
	end
	
end)

1 answer

i found the answer for myself!!

turns out the problem isnt even in this script!

while wait(1/1000) do
	local hit,Position = game.Workspace:FindPartOnRayWithIgnoreList(RayCast,{script.Parent})
	if hit then
		script.Parent.Position = Position
		break
	end
end

i actually found a good tutorial for once in my life

1 comment

0

This is a deprecated method. Please use workspace:Raycast() and RaycastParams.

This discussion is preserved as it was. New answers, comments, and votes are closed.