-
What do I want to achieve?
A working script. -
What is the issue?
I get this error no matter what i do.
This is the script snippet:
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
raycastParams.FilterDescendantsInstances = {Character, game.Workspace:WaitForChild("EnvironmentTriggers"), game.Workspace:WaitForChild("TerrainTriggers"), game.Workspace:WaitForChild("SoundRegions"), game.Workspace:WaitForChild("BuoyGivers")}
local lastCFrame = clone.CFrame
local raycastResults = game.Workspace:Raycast(Character:WaitForChild("Head").Position, mouse.UnitRay.Position * 1000, raycastParams)
local hitPosition = raycastResults.Position
local part = Instance.new("Part")
part.Position = hitPosition
part.Size = Vector3.new(0.125,0.125,0.125)
part.Anchored = true
part.CanCollide = false
part.CanQuery = false
part.Material = Enum.Material.Neon
part.Parent = game.Workspace
- What solutions have I tried so far?
- Looking on the developer hub
This is a part of a script that is situated inside a Runservice.RenderStepped function