i can write up some code to demonstrate but basically you want to use two parts, rectangles, that overlap, and position them at 45’s from the player
example:
i can write up some code to demonstrate but basically you want to use two parts, rectangles, that overlap, and position them at 45’s from the player
example:
you can also do this with UI (and i’d suggest it)
An example would be helpful because I’m not sure I’m sure what you mean
I can’t do it that way, because you will see the player even if it is very very dark, so I would like to make a special triangle like in the picture, to enter my own values of what should happen in them, etc.
That’s exactly the kind of thing you had in mind
That’s why I want to do away with particles, so that there is no advantage for weaker equipment
So here is what I did:
Create A Part with a flashlight in it. Part must be anchored and uncollidable (and invisible)
SpotLight Settings:
Angle: 120
Brightness: 20
Range: 60
Shadows: Disabled
Lighting Changed Settings:
Ambient: 0, 0, 0
Brightness: 0
EnvironmentDiffuseScale: 0
EnvironmentSpecularScale: 0
OutdoorAmbient: 0,0,0
Technology: Future
and this is the script i used
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hRP = character:WaitForChild("HumanoidRootPart")
local camera = workspace.CurrentCamera
local fl = game.ReplicatedStorage:WaitForChild("fl")
local flashlight = fl:Clone()
flashlight.Parent = hRP
camera.CameraType = Enum.CameraType.Scriptable
local mouse = player:GetMouse()
game:GetService("RunService").RenderStepped:Connect(function()
local characterpos = character:GetPivot().Position
character:SetPrimaryPartCFrame(CFrame.new(hRP.CFrame.Position, Vector3.new(mouse.Hit.Position.X, hRP.CFrame.Position.Y, mouse.Hit.Position.Z)))
local Distance = math.clamp((camera.CFrame.Position - characterpos).Magnitude, 20, 20)
camera.CFrame = CFrame.lookAt(characterpos + Vector3.new(0, Distance, 0.5), characterpos)
flashlight.CFrame = hRP.CFrame * CFrame.new(0, 0, 2)-- offset
end)
just replace camera script if you have to.
As @InfiniteYield said, a solid GUI on screen Make it look liek a solid fog background with a clear triangle cut out and blurred edges between the solid and clear sections.
Put the GUI on screen and center it to the player’s Position. figure out where the player is pointing on screen and rotate the GUI.
The other option is if the camera is alway directly above the player then place a SurfaceGUI or decal on a Transparent Part with the same wedge shaped fog image. Position it in the workspace so it’s directly above the player, or even weld it to the player make it a small Part with a BlockMesh in it to make the fog extend off the screen so the edges are never visible.
Roblox doesn’t have custom shader support, so your options are:
* Normally the darkness would be black, though there might be lighting settings or post processing Instances to change the color of the darkness to make it look like misty lighter fog
The respective posts are the solutions. There aren’t other ways to do this (besides beams or semi-transparent meshes and other overly complicated, equally or less functional solutions than the ones above).
did you know you can use negative lighting in future? it will make anything it touches completely black. this could work, although it is bad quality.
he means use ui that looks like fog, and make it go around the player. this is unreliable, however.
It would also work to have everything dark to start then use a spot light in the forward direction.
That is actually super cool though.
ik, but the spotlight could easily not work. for one thing, it could lag and make the player walk into it. same for my idea though.
The spotlight instance could be placed in an attachment positioned above the humanoid root part. Then the light would go in the direction of the player.
The player could also be marked as CastShadow = false, then the character wouldn’t block the spotlight and it could be placed directly in the HRP.
Having a spotlight shouldn’t cause any performance issues, they’re used all the time in games.
I think the OP is okay with the player seeing themselves. The spotlight would be inside the player, so it would move with them as they walk.
Do you mean with low graphics settings the lighting wouldn’t render the darkness properly so they could still see? I guess a UI could be used on the edges to make sure this doesn’t happen.
ik, but on low graphics you could walk into it and see yourself.
The effect is good, the only problem is that the player should be clearly visible, and the light should not reflect so much on the player.
I decided to add another block that shines over my head but the effect is meager but not too bad. Does anyone have a better idea?
add particles coming from the fog. lockedtopart particles.