Issue Type: Other Impact: High Frequency: Constantly Date First Experienced: 2021-02-11 22:02:00 (-05:00) Date Last Experienced: 2021-02-12 03:02:00 (-05:00)
Reproduction Steps:
I cannot guarantee you will be able to reproduce the issue, as my it isn’t occurring for my friend. The issue occurs at every place I edit.
Expected Behavior:
Raycasts properly intersect with the Terrain.
Actual Behavior:
Raycasts only very rarely intersect with Terrain. This causes the terrain brushes to no longer function properly, draggers to no longer work over when over terrain, and more.
There are no invisible parts or mesh/unions blocking collision where I am moving the brush.
This breaks my workflow, as a good portion of the terrain in my map is no longer editable as I cannot use the brush on it.
EDIT: The issue is with raycasting, not the Terrain Editor plugin. It happens at any height, and has been happening since the Roblox update on February 10th, 2021.
EDIT 2: A workaround has been posted in the replies. Specifically this reply by @DevelopingRepo.
Do you have a part called Baseplate? The terrain brush looks for both Terrain, and Baseplate - the intention there was to make it easier to start adding terrain from a brand new place.
The logic is:
Cast a ray that’s only interested in terrain and baseplate (if it exists)
If we hit something, use it
Otherwise mathematically intersect the ray with the y=0 plane
If that’s successful, we use that
But if it failed (e.g. camera is above the plane and looking up), use a point some amount of studs in front of the camera
We do not have a part named baseplate. With the size of the map it’s not feasible to have one. I tried adding one to see if it made a difference, and it did let me move the brush around on that part regardless of the Y position. However the issue here are these points:
Cast a ray that’s only interested in terrain and baseplate (if it exists)
If we hit something, use it
Following your logic, shouldn’t the ray be intersecting with the terrain regardless of if a baseplate is present? The terrain exists there, it just acts as if it does not exist below the point Y = 0. Basically I cannot interact with terrain below that point without a baseplate now.
So taking what I understand, it seems that the editor brushes are failing to properly detect terrain being hit by the ray it casts if said terrain is below the XZ-plane (Y < 0). I apologize if I’m misunderstanding the mechanics behind it. Please feel free to correct me.
I can DM you a copy of the place that I’m working which has the problem. I took the liberty of modifying the terrain plugin to get it working enough to debug the problem. It seems that the issue is not with the Terrain plugin itself, but either WorldRoot:Raycast() or the Terrain Instance.
When in studio (non-Run mode), WorldRoot:Raycast() frequently misses the Terrain Instance. I believe it was changed in the last update, or perhaps a result of some FFlag. I do not know if this is due to changes within the Raycast implementation or a recent Terrain change.
Here’s video of the modified terrain plugin where I added debug prints directly after the raycast call. You can see in the output it rarely intersects with the Terrain Instance.
I think this is not only happening with terrain brush, it’s also happening with attempting to drag an object onto a piece of terrain.
In the video shown below, I tried to drag a structure onto a heightmap generated terrain (Heightmap 1) and I expected this structure to bound itself to the terrain. As shown, it is being extremely weird and it just doesn’t bound to the terrain. The same issue is happening to the terrain brush and other things.
For the record, *I tried using baseplates to solve my problem, but it didn’t work as this is a piece of heightmap and we’re working with tons of it, so essentially it would be tough for me to cover up the entire map with baseplate at various different heights.
Update: Creating a baseplate or baseplates do not fix the issue.
The issue seems to be that raycasting can fail (and frequently does fail) to intersect with the terrain. It only happens in edit mode from what I can tell. This means anything that involves raycasting is effectively broken with terrain. Draggers, the terrain editor, other plugins, etc. Hopefully there’ll be a resolution to it in this week’s update or a FFlag revert if that route is possible.
This is really disrupting my workflow. I haven’t been able to fix or add new terrain to my game for the past few days because of it. Hope it’s fixed soon.
I see, all hopes high for them to fix it. A question for you though, how were you able to print the raycast? Is it a script or is it a setting that can be changed?
I would really appreciate if this was fixed soon, as though it’s possible to work around, it’s terribly inconvenient.
One strange behavior is that the raycast only fails from certain angles seeming to be a chunk error, and yet it behaves fine with part dragging, avatar collisions etc.
I edited the built in terrain plugin to see if I could find a temporary fix. When I discovered it was a raycasting issue and not related to the terrain plugin I gave up. There’s not much we can do about the internal raycast mechanism failing.
Same here, running the game and opening the terrain editor completely solves the issue. Knowing Roblox though, I could also see this as them half**sing this and only half rolling out this update to edit mode without applying any changes to the run mode. Nonsensical but I know you see it happening too.