How should I go about creating a ground pound system?

I want to determine the parts (on the ground) directly in front of the player so that I may act on them. How would I do this?

Create a hitbox, facing the player’s direction. If the hitbox is touching a part, then the player can act on them

I would raycast infront of a player and check to see if it hits a viable part, then manipulate that part how you like. Or use Region3, create a space using Region3 infront of the player and return the parts that belong in that region

I would not recommend raycasting because there are some theories that it can cause memory problems, but region3 can be used
Edit: Tested raycasting and region3 just now, raycasting caused higher memory spikes, maybe it’s just me though

Ok i would recommend Region3 then. Touched events can be faulty.

Are you using

workspace:Raycast()
or
Ray.new()

I’m using workspace:Raycast()

Yeah im not entirely sure whats causing that. I do not experience this issue and i havent known anyone to experience this issue aswell.

I guess it could just be my pc lol

I would try using WorldRoot:GetPartBoundsInRadius(). It will return an array of parts whose bounding boxes overlap a sphere whose volume is described using the given center (Vector3) and radius (number). You can read about it here: WorldRoot:GetPartBoundsInRadius. Its perfect for a ground pound kind of thing.

Nvm, figured this one out on my own, thanks to everyone that replied!

The “meat” of my ground pound system is shown below:

local function getDestinationVectors(char)
	local hrp = char:FindFirstChild("HumanoidRootPart")
	local vectorArray = {}
	
	for i = 1, 100 do
		local y = -i --It rhymes
		local newCFrame = CFrame.new(0, y, -50)
		local offsetCFrame = (hrp.CFrame + Vector3.new(0, 50, 0)):ToWorldSpace(newCFrame)
		table.insert(vectorArray, Vector3.new(offsetCFrame.X, offsetCFrame.Y, offsetCFrame.Z))
	end
	return vectorArray
end

This script basically just returns an array of vector3s which can be raycasted towards, offset to varying degrees in front of the player. Although inefficient, it suits my application very nicely.

2 Likes