Raycast Not Raycasting Correctly

Hello all! I was planning on raycasting to a point on the terrain so I could place an item down at that position, but it hasn’t been working. It’s been offset a lot, and not going to the specific point that it “seems” to intersect at. I don’t know what’s going wrong here. Any help is appreciated. Thank you.

image

       local oppFetMod
		
		for l, m in pairs(game.Workspace:FindFirstChild(player.Name.."'s Battle Scene").Feterians:GetDescendants()) do
			if m.Name == "OpponentFeterianTag" then
				oppFetMod = m.Parent
			end
		end
		
		--
		
		local tweenPos = oppFetMod.PrimaryPart.Position
		
		local oppRayDir = oppFetMod.PrimaryPart.CFrame * CFrame.new(0,-50,0)
		
		local raycastResults = game.Workspace:Raycast(oppFetMod.PrimaryPart.Position,oppRayDir.Position)
		
		print(raycastResults)
		
		if raycastResults then
			if raycastResults.Instance.Name == "Terrain" then
				warn("EEEEEEEEE")
				
				tweenPos = raycastResults.Position
			end
		end
		
		game.Workspace.esrtttetetat.Position = tweenPos
		
		local tween = tweenService:Create(catchingKitModel,tweenInfo,{Position = tweenPos})
		tween:Play()
		
		--
		
		tween.Completed:Wait()

I’ve found the solution myself and now I will be listening to clown music for the next hour. Thank you all.

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