What does widget grid panel have to do with character movement? Or is this not about widget Grid Panel? You may need to elaborate on what the end goal is. Are you making a game that is 2d only?
How should I constrain the characters or “game pieces” to the grid
Many ways. Really depending on how things are supposed to move, I can imagine so many ways… You did not specify how the character is moving? Click → move to location, keyboard keys, some other method?
- you can provide target coordinate from a line trace
- you could snap vectors if you’re using pure math and locations are known upfront
- you could use navmesh to determine pathfinding
Would character go through things like the levels walls or rubble and if so how would I prevent that
It would depend on the method of movement. Perhaps it’s enough to never attempt to move the character where they shouldn’t go in the first place. If you provide valid coords, they won’t go anywhere else.
If the target location is undetermined or is too dynamic to figure out the final destination upfront, you may need to rely on the line traces to sample the environment around you and adapt on the fly.
Honestly, there simply is not enough detail in the question to suggest something tangible. Consider fleshing it out.