bonsairobo / smooth-bevy-cameras

Bevy camera controllers with buttery, exponential smoothing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Limit where the camera can move

musjj opened this issue · comments

Can we limit the camera so that it doesn't move beyond a certain bound? I think this would be pretty useful for 2D games.

Sounds like something that could be implemented outside of this crate. Maybe try it yourself first and see if you can make something satisfactory.

I could imagine having some kind of TransformBounds component and a system that clamps the transform into the bounds defined there.

I decided to just clamp the value of the position, before setting it to target or eye. I guess this is good enough.