yayyyyyy!!! (idk any math to fix this and I used special mesh to fix this as a shortcut but, yep.)
also heres the thingmajig (part of the code):
function Equipped()
local function Make_Cool_Client_Stuff()
SnowMeter = SnowMeter_Ref:Clone()
SnowMeter.Parent = Plr.PlayerGui
Ghost = Instance.new("Part")
Ghost.Size = Vector3.one * 2
Ghost.Anchored = true
Ghost.CanCollide = false
Ghost.Position = Vector3.zero
Ghost.Parent = workspace
Param.ExcludeInstances = {Chr, Ghost}
Param.IncludeInstances = {workspace:FindFirstChild("SnowFolder", true)}
end
local function Render()
task.wait()
SnowMeter.TextLabel.Text = Chr:GetAttribute("Snow")
local Locate = Services.User_Input:GetMouseLocation()
local CamPort = Cam:ViewportPointToRay(Locate.X, Locate.Y)
local Rayrender = workspace:Raycast(CamPort.Origin, CamPort.Direction * 1000, Param)
if (Rayrender) then
print("raytastic!")
Ghost.Position = Rayrender.Instance.Position + (Rayrender.Normal) * Ghost.Size
print(Rayrender.Normal)
end
end
task.spawn(Make_Cool_Client_Stuff)
Services.Run_Service:BindToRenderStep("UPDATE_TEXT_NAME", 1, Render)
end
wait I minute I thought of smth gotta try it
(nvm)
thought of smth but may hurt the performace so gotta test
nvm I realized how hard its gonna be
did try to use mouse object TargetSurface with it and it didn’t work
(I mean I also did swap the raycast with pure mouse but uhhhhh)
Not sure how to fix the edge snapping issue but the code is quite odd. The function names aren’t descriptive, what do you mean by “make cool client stuff”? Is this temproary throwaway or an actual system for a game? Second I don’t understand why you need a dictionary of services to index them from there. Third, I understand if it’s a habit from other languages, but in Luau you don’t need to wrap conditions in braces and for a condition as simple as if Rayrender with no operator precedence issues it’s just odd. Fourth unless you really need it I wouldn’t make global functions when they’re not being exposed to other scripts and fifth if you’re calling Equipped every time the tool is equipped and not disconnecting the RenderStep bind that’s a memory leak and may also cause weird stuff. These are just suggestions irrelevant to the edge snapping but but it will make your code more readable and easier to understand and maybe solve that memory leak I mentioned earlier
it does disconnect the bindtorender when uneqipped
FOUND IT FINALLY
(its just cframe with 7 if gates with the legacy mouse instance)
Why is John Half-Life just staring you down 24/7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
