I'm using stepify for an object that I'm dragging in an isometric grid however stepify isn't exactly my solution.

One way I thought of using stepify was to have two stepify functions one that has a vertical offset at the specific x value where it is needed. However I don't know how to add an offset to stepify without adding random values as it still needs to be represented by my mouse position.

Or there might be a better solution.

Any help is appreciated!

If you're using an actual TileMap, you can use it to get the discrete steps:

func rounder(pos:Vector2) -> Vector2:
	var map = get_node('TileMap')

	var p1 = map.to_local(pos)
	var p2 = map.world_to_map(p1).round()
	var p3 = map.map_to_world(p2)
	var p4 = map.to_global(p3)
	p4.y += round(map.cell_size.y / 2.0)

	return p4

Hey, thanks for your reply.

I am using a TileMap however your solution seems not to work unless I've done something wrong

Never mind, I did something wrong but it works now!

Thanks a lot!

7 months later