Creating points around character

Is there a simple method for generating points around a character no many how much points there are? This is useful for pet systems from simulators, magic based games, card games, stuff like that. It’s also just something I really find intriguing.

Anyways this is pretty much the only method I could come up with for it, but it’s incomplete and I’m unsure where to continue, or if I’m doing it wrong.

function createCircle(num)
	local increment = 1 / num
	for i = 1, num, increment do
		local part = Instance.new("Part") -- just a part for visualizing
		part.Size = Vector3.new(.5,.5,.5)
		part.Anchored=true
		part.CFrame = bla -- i'm really just unsure how the math works
	end
end
createCircle(5) -- should create 5 points around your character

The for loop is supposed to loop depending on how many items should be around your character. The increment is for adjusting the scale of the position based on the number of items. That’s pretty much how far I got, I can’t really think up any algorithm for the cframing part.

The thing you could do is to take 360 degrees and devide it by 5, then use the cframe of the humanoidrootpart to rotate and move the part out. That way you could create points around the player

HRP.CFrame * CFrame.Angles(0,(360/AmountOfPoints)* n, 0) * CFrame.new(0,0,DistanceFromPlayer)

I think this should work but im not 100%

1 Like

Yeah actually I think that would work, I’ll give it a try thanks a lot for this.