I’ve seen many people ask about locking the camera on a part, but I was wondering how to do the reverse. I need this because I’m trying to make a rain system so the particles are locked on the camera at all time (not necessarily the orientation though)
So you want the rain to travel via the Z-Axis towards the players view?
Do you mean something like this? (LocalScript)
local RunService = game:GetService("RunService")
local LockOnPart = workspace:WaitForChild("Part")
local Camera = workspace.CurrentCamera
local function UpdateCamera()
local X, Y, Z = Camera.CFrame.X, Camera.CFrame.Y, Camera.CFrame.Z
local CameraPos = Vector3.new(X, Y, Z)
Camera.CFrame = CFrame.lookAt(CameraPos, LockOnPart.Position)
end
RunService.Heartbeat:Connect(UpdateCamera)
Not sure what you mean, but it’s travelling down in the y direction. I want this part to sit above the camera so that it still looks decent from a first and third person perspective
Or you could just make the rain part the entire zone.
I already did this once with my game called Thunderstorm. Check it out to see if it’s what you want.
No, what I’m trying to do is the opposite. I’m trying to have the part where the rain is coming out stay at the position of the camera, so it’s always sitting on top of where the camera part is
Ok so get where the camera is located and set the part to the same offset from the character as the camera with more Y axis so it’s higher.
You may need to scale it at the same rate as the scroll wheel when moving camera in and out.
Yeah this is exactly what I’m looking for! How do I achieve this?
That’s a fair bit of work. At least you know what to search for now. I wish you well.
You’ll have to look through all these to see how exactly the camera works so you can mimic it’s movements.
I think I might be able to blanket the map with multiple particle emitter parts and just turn up the rate really high (the map isn’t that large anyways) Would this cause performance issues? It doesn’t rain all the time in that game by the way
just a single part stretched over the zone. Start with 1 particle emitter and keep upping the rate until you can’t anymore. Then if that’s not enough, duplicate it.
Something like this?
we need more pictures!
local RunService = game:GetService("RunService")
local RainPart = workspace:WaitForChild("RainPart")
local Cam = workspace.CurrentCamera
local Offset = Vector3.new(0, 10, 0)
RunService.RenderStepped:Connect(function(dt)
RainPart.Position = Cam.CFrame.Position + Offset
end)
like this?
just find the camera, and lock a part to it with a runservice script, then add a particle emitter to that and enable lock to part
Make it rain!!! … so basically you have rain following the camera, but don’t you need to move the rainpart as the camera moves? which is probably going to look whacky if you move the camera around fast and the rain has not dropped yet… ,maybe create a sphere or square that is above the camera or player and is always raining…
can you put the part inside the camera and the p e also ?
yeah
parent it to workspace.CurrentCamera
Adjusting offset or make rain drops faster would fix that I guess