# Not sure how to achieve this

Hey guys. The preface as always is I’m working on a top-down space ship arena shootemup.

Thing is, up until now I’ve had my borders of the arena at the side of the screen for ease. Now I want to work on expanding that. If the arena is bigger than the screen I see, I need the camera to move with the player. I tried reparenting the camera to the player, but that also brought along orientation (the camera spun when the player did, made me kinda dizzy).

My current idea is this: a ‘dead zone’ in the middle of the screen the player can move around without moving the camera. (See this picture) If the player hits the edge of that dead zone, the camera starts to move with the player up until it reaches the edge of the arena (as seen here).

At that point, the camera doesn’t move until the player gets back through the relative dead zone again.

I don’t need explicit code, just ideas of how to do this.

Bonus points if you can think of a way that works with non-rectangular arenas (circles) as that’s my next question.

Thanks for the read!

you can try to have a camera node that has the same position as the player then then reparent the camera to that. This way you will not have the hpr being messed with. You could also have the camera parented to the player and then force the hpr of the camera to the default hpr that you want it to by changing the hpr of the camera every time you change the hpr of the player. The only problem with that is that you might end up with the camera being jittery.

I’d put a inverse sphere collision solid in front of the camera, on the plane that the player-ship moves. The ship would have a normal collision sphere.

When there is a collision of these then that means the ship is about to go out of the screen. In that moment start a Pos interval to move the camera to a point directly above the player-ship. The interval could even react to the player movment after the interval started.

You’d need only one interval at a time so when one is running you’d ignor new collisions.

I can write a bit of code if my words have no sens.