Terrain grass not loading in properly when playing, yet loads fine in studio

I am attempting to create some terrain in my game, after years of using studio, this will be my first time using terrain, so I am, for the most part, clueless about it, and have run into an issue. The grass on my terrain loads fine while editing in studio, no issues. However, when I playtest, or play on roblox, the grass is much more thinned out, and gradually gets thicker the closer I am to the center of the map, until it is back to normal.

Here it is in studio:

And here it is when playtesting:

Here are a few examples of these “breaks” in the terrain where grass transitions to a thicker portion (a bit difficult to tell in the second image without close inspection):


I dont know why it is doing this, and have searched all over devforums as well as the internet and have found no one with the same problem. My only conclusion is that the custom camera script I have is causing the players camera to be stuck at the center of the map, so the grass is only loading in response to what the camera would see. Here is my camera script, it is for a 2D game:

local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera

player.CharacterAdded:Wait()
player.Character:WaitForChild("HumanoidRootPart")

camera.CameraSubject = player.Character.HumanoidRootPart
camera.CameraType = Enum.CameraType.Attach
camera.FieldOfView = 60

local RunService = game:GetService("RunService")

local function onUpdate()
	if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
		camera.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position) * CFrame.new(0,0,30)
	end
end

RunService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onUpdate)

Any help would be greatly appreciated! As well as correcting me on my camera script if that is the problem, I am very open to constructive criticism, as I am still fairly new to scripting.

EDIT:
I found the solution but decided to post anyways in case others come across the same issue. The problem was that the camera is set to “Attach”, just change it to “Scriptable” in the script and the issue will be solved.
The issue was a simple overlook on my part.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.