How to spawn objects on top of the terrain(grass)?

The thing is, I recently made a system, and I want that system to take up multiple objects, and I want those objects to spawn randomly across the grassy terrain. I just want to know how to put an object on top of the grass field

1 Like

Can you give me copy of the game so I can figure out how to do it?

1 Like

I haven’t really started doing anything yet because I have no idea how to use the terrain

Create triangles connecting to the verticies of the building to the grassy terrain. Add some noise for variety and realism then convert those triangles to terrain. Conforming the terrain to suite the new building.

You could use raycasting since raycasting can detect terrain cells

I have never used terrain in scripts so I don’t know how to use it

If you want you can use a different method like this
Spawn part on top of terrain then scroll down to part proprieties until you see the part position, then you can just get that part position and paste it in your script.

You can do raycasts on a top down view of the terrain map and use the raycast Position property to position your objects

1 Like

Try doing something like this

I’m just typing an example I don’t think you’re doing something like this

local CFToAdd =, something:number, something:number) -- add values accordingly to terrain height
function createObject(obj) -- idk whatever you're using, im using a function as an example
    -- spawning code above
    --obj here is the object you're spawning
    obj.CFrame += CFToAdd