Dynamic grid under player

A grid that seamlessly follows the player and conforms to the floor below them. Made using an editablemesh (beta feature so it can’t be used in games yet).
2024-02-28 16-30-09 - Trim.mp4
Benchmarked at 2 ms per heartbeat, might optimize it a little more when I feel like it.

UPDATE: Got it down to 700-800 microseconds by fiddling with how it casts rays and updates the vertices. Native code FTW!

2 Likes

This looks interesting, What would be the use for it? Building maybe?

1 Like

Ye, its for a in-game level editor

1 Like

how do you do it, that looks cool

Raycasts and editablemeshes mostly

do your raycast at each corner, and then edit position based on that, or something else?

Pretty much yeah. It also caches each ray’s previous height into a separate table so if it ends up being at the same height it doesn’t bother updating that specific vertex.