Alright, what about a grid?

Lets say I wanted to make a thing for survival or something, I would like it to be on a grid. Is it posable to make it so I raycast, on hit point, it instantiates a prefab, but it find the closest grid unity, and places it in the center of it? Also another question not needing a answer for now, how would I make it so I can detect if a object is using up a grid space that what I want to place is placing in? so I can plac 2 objects in the same grid space?

I already know how to instantiate, and raycast it to the hit, and I knowa little about mathf.round , But I am not sure how to do the rest.

Is it possible to make it so I raycast, on hit point, it instantiates a prefab, but it find the closest grid unity, and places it in the center of it?

  • Yes.

how would I make it so I can detect if a object is using up a grid space that what I want to place is placing in?

  • You could keep track of what you put where and refer to that structure to determine the state of a grid cell, or you could utilize Unity’s collision detection.