Raycast not picking up terrain generated by script

  1. What do you want to achieve?

Ray cast procedurally generated terrain

  1. What is the issue?

If for example I do

game.Workspace.Terrain:FillBall(Vector3.new(12, 30, 12), 7, Enum.Material.Sand)

and next do a ray cast trough this terrain, it’s not registering a hit. But if I put wait(3) between, then it registers the hit.

  1. What solutions have you tried so far?

Haven’t found any real solutions, as there is no callback when generated terrain is ready / processed properly, so it can be picked up by, for example, raycast.

Can you please post all the code here so we can help you find the issue?

You are not raycasting anywhere. You are just using one line of code to generate a ball of terrain.

If you want you can also DM / message me on the devforum, and share the code with me in the message so that way I can help you out privately.