Causing blocks to naturally fall

I want to create block entities that break off when you mine a block, and that will fall to the ground in a natural way. Atm, all I got is a raycast vertically down to the ground, however, problems I have with this is

  1. Blocks fall vertically down, instead of having a more random drop
  2. When you mine a block with entities on it, those entities don’t fall

What I mean in the first point, is I want the entity to ‘fly off’ from the block, instead of just falling vertically down, giving them random trajectory to the ground.
ezgif.com-gif-maker (40)

--// New entity was created
local function NewEntity(entity)
	local Params = RaycastParams.new()
	Params.FilterType = Enum.RaycastFilterType.Whitelist
	Params.FilterDescendantsInstances = {Islands}
	Params.IgnoreWater = true
	
	local NewRay = workspace:Raycast(
		entity.Position,
		Vector3.new(0, -123456789, 0),
		Params
	)
	
	if not NewRay then return end
			
	local TweenToFloor = TweenService:Create(
		entity,
		TweenInfo.new(
			math.sqrt((entity.Position.Y - NewRay.Position.Y) / 16),
			Enum.EasingStyle.Linear
		),
		{Position = NewRay.Position + Vector3.new(0, 0.75, 0)}
	)
	TweenToFloor:Play()
	TweenToFloor.Completed:Wait()
	
	local NewPosition = entity.Position + Vector3.new(0, 0.75, 0)
	
	local BobTween = TweenService:Create(
		entity,
		TweenInfo.new(
			1,
			Enum.EasingStyle.Linear,
			Enum.EasingDirection.Out,
			-1,
			true
		),
		{Position = NewPosition}
	)
	
	BobTween:Play() -- Make entity bob up and down
	
	-- Make entity rotate
	coroutine.wrap(function()
		while wait() do
			entity.Orientation = Vector3.new(0, entity.Orientation.Y + 2, 0)
		end
	end)()
end

Maybe try welding the tree branches, then destroy the weld(s) when triggered?

What?? I’m slightly confused on how your suggestion could fix my problem

My bad, I misinterpreted the video with your post.

You could maybe use math.random and add some random directional velocity using that.

I’m wanting to make gravity on the blocks tho

lol minecraft-like game but blocks have gravity.
I’m thinking, weld the blocks to other blocks, then unanchor the blocks. But it may glitch, i dunno i am not that good with welds

Maybe making a script to un-anchor the part once the lowest part is broken then re-anchoring it can help?

cc @ChillyGuast

I don’t think you’s understand what I want. I don’t want blocks to have gravity, I want the entities to. Those little blocks that appear when you mine a block, I want them to have gravity.

Sorry, I must’ve misread what you have said.

Why don’t you use AlignPosition and AlignOrientation and set the ‘entities’ attachments’ properties? Although this would add a higher load to the physics engine, you wouldn’t need to use raycasting. Plus hard-coding a BasePart’s CFrame by setting its orientation is not good practice.