Hi, I’m attempting to make my sea “move” 100 studs in front of where my camera is facing. This is my current code:
local Camera = workspace.CurrentCamera
local Sea = workspace:WaitForChild('Map'):WaitForChild('Ocean'):WaitForChild('Main1')
while true do -- Plan on replacing this with a renderstepped and heartbeat, just trying to get this to work
wait()
local LookAt = Camera.CFrame
--Sea.CFrame = CFrame.new(Sea.CFrame.p, Vector3.new(LookAt.X, Sea.CFrame.p.Y, LookAt.Z * 200)) -- This solution didn't really work
Sea.Position = Vector3.new(Camera.CFrame.Position.X, Sea.Position.Y, Camera.CFrame.Position.Z) -- Best solution, but doesn't do exactly what I want
end
What it does (displayed) and where I want it (blue line):
I’m attempting to solve this issue where my billboardguis and bubble chat is rendering behind the slightly transparent sea by making sure the center of the sea is further back than where the camera is facing at all times, as @Corecii said.
I’ll be honest, I’m not very good with cframes and the math related with it. I’ve never fully understood it. Any help would be appreciated!