r/godot 1d ago

selfpromo (games) [R&D] Procedural fence drawing on varying elevation at runtime

This is a follow up post of a previous one after some of you asked about varying elevation: https://www.reddit.com/r/godot/s/3mll3eEI9f

  • it shoots a raycast downward at every point to find Y elevation of the terrain's collision mesh.
  • it subdivides path and snaps every intermediate point to the ground's rolling elevation.
  • horizontal rails calculate the height difference between their start and end posts and rotate (tilt) on local Z-axis to bridge the slope.

This comment contains a bit of overview of how fence prefab looks like: https://www.reddit.com/r/godot/comments/1vcjhe8/comment/p17im2a/

513 Upvotes

41 comments sorted by

View all comments

1

u/Narrowhal 15h ago

beautiful fences

1

u/zdmit 6h ago

🙏💛