[SOLVED] 2d deadzone cameras

I’m making a 2D platformer game and I want to make a camera that has a deadzone for my player. Is there any way to do that? Thanks in advance!

Create a sprite called CameraTarget
Create an always action: Camera centers on object CameraTarget
Create a condition:
If CameraTarget.DistanceTo(Player) > Variable(Deadzone) then Move CameraTarget X = lerp(CameraTarget.CenterX(), Player.CenterX()) Y= lerp(CameraTarget.CenterY(), Player.CenterY())

Sorry for my ignorance on coding, but can you go into more detail on what you said.

Hi you can check this too maybe helps

Or this

Other

Thank you, but all those videos make the camera move with the player immediately even with the smoothing, and I personally don’t want an immediate moving camera as I believe it would cause the player to strain their eyes more than needed. I personally would like a camera with a deadzone.

I use an extension but I can’t remember where to download.
Here the extension

You need to create a new sprite to use it as tracker .
the distance param is the distance between tracker and player lerp time in seconds to update the tracker to move to player.
Use it like this.

2 Likes

Can I just say how much of a lifesaver you are! Thank you so much! It feels good to rewrite the title to [SOLVED]