Player Circle Outline Help

How would I get the circle to appear on the new brick?

The script is a local script inside of StarterPlayerScripts: > wait(1)

local Character = game.Players.LocalPlayer.Character
local part = script.CirclePart:Clone()
part.Parent = Character
local Range = (part.Range.Value * 2)
local RotationSpeed = 0.035

local Run_Service = game:GetService(“RunService”)

local groundYPosition = Character.HumanoidRootPart.Position.Y - 3

Run_Service.RenderStepped:Connect(function()
part.Size = Vector3.new(Range, 0.13, Range)
local currentPosition = Character.HumanoidRootPart.Position
part.Position = Vector3.new(currentPosition.X, groundYPosition, currentPosition.Z)
part.CFrame = part.CFrame * CFrame.fromEulerAnglesXYZ(0, RotationSpeed, 0)
end)

Im new to scripting so I may be wrong but you will need to update the groundYPosition

also also maybe move this to #help-and-feedback:scripting-support

you can do it with raycasting

local Character = game.Players.LocalPlayer.Character
local part = script.CirclePart:Clone()
part.Parent = Character
local Range = (part.Range.Value * 2)
local RotationSpeed = 0.035

local Run_Service = game:GetService("RunService")

local groundYPosition = Character.HumanoidRootPart.Position.Y - 3

Run_Service.RenderStepped:Connect(function()
	part.Size = Vector3.new(Range, 0.13, Range)
	local currentPosition = Character.HumanoidRootPart.Position
	
	local params = RaycastParams.new()
	params.FilterType = Enum.RaycastFilterType.Exclude
	params.FilterDescendantsInstances = {part, Character}
	local raycastResult = workspace:Raycast(currentPosition, Vector3.new(0, -50, 0), params)
	if raycastResult then
		part.Position = Vector3.new(currentPosition.X, raycastResult.Position.Y, currentPosition.Z)
	else
		part.Position = Vector3.new(currentPosition.X, groundYPosition, currentPosition.Z)
	end
	part.CFrame = part.CFrame * CFrame.fromEulerAnglesXYZ(0, RotationSpeed, 0)
end)
1 Like

You need to use Raycasting. Here is a code example, it probably isn’t right but its something you could use as reference.

local Running
local RunService = game:GetService("RunService")

local Params = RaycastParams.new()
Params.FilterType = Enum.RaycastFilterType.Exclude

Running = RunService.RenderStepped:Connect(function()
local CastFrom = HumanoidRootPart.Position
local CastTo = CastFrom + Vector3.new(0,-0.1,0)

local Raycast = workspace:Raycast(CastFrom, (CastTo - CastFrom).Unit * 250, Params)

if Raycast then
Circle.Position = Raycast.Positon
end

end)
1 Like

Thank you to everybody who helped and supported me with my issue! I needed to use Raycasting as @Shinrai12 and @VisuallyFX said!

3 Likes

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