You can write your topic however you want, but you need to answer these questions:
-
I want to spawn an aura at the ground directly under the player
-
Aura does not spawn where I want it to. It will spawn under the player, but the aura is not centered.
-
I tried raycasting from lowertorso and humanoidrootpart but that never fixed anything.
My Code:
local Character = script.Parent
local HumanoidRootPart = Character.PrimaryPart
HumanoidRootPart.Anchored = true
local Params = RaycastParams.new()
Params.FilterDescendantsInstances = {Character}
local AuraRaycast = workspace:Raycast(HumanoidRootPart.Position, HumanoidRootPart.Position - Vector3.new(0, 50, 0), Params)
if AuraRaycast then
local Position = AuraRaycast.Position
local Aura = script.Aura:Clone()
Aura.Parent = Character
Aura.Position = Position
Aura.Position = Aura.Position + Vector3.new(0, Aura.Size.Y/2, 0)
Aura.Anchored = true
Aura.CanCollide = false
end