I want the camera to zoom out when players go out of the camera’s reach, Kinda like super smash bros I think. Thanks!
@ManiacPumpkin You may know how to do this.
You can use the Camera’s zoom input and I think if the value is smaller than 100, it starts to upscale the camera’s view to a larger area.
You could just take the distance between both players and when it starts to exceed a specific number, it’ll zoom out the camera.
If it’s a platformer, I would recommend only using the player’s X positions instead of including Y because in Smash Bros, when you fly in the air, the camera doesn’t track you other than a marker.
Wait a while, I know how to do this, I’ll make an example game real quick.
Good idea, but I don’t know how to do this.
Okay, cool!
Do you want 2 players, or 3+
it’s just Math.abs(x1 - x2) for x distance then filter it to see if the camera needs to zoom out or not
The game will be optional of how many players. The options are: 2 players, 3 players and 4 players.
Alright, I’m making it rn
Cool, thanks so much! Thank for your help @Galactian and thank you for your help @ManiacPumpkin.
Sorry for the wait, my brain was not working.
But finally, here:
https://flowlab.io/game/view/2372804
It will find the min x, max x, min y, max y, of all your players. So if you need more / less players, just take out a couple variables. Also the C variable is the screen width. You’ll see the comment on the expression, just change the value of C to the width + hight of the screen
Okay thanks! I’ll try it out.
Alright! It works. Please don’t delete this example though. I might still need it AND other people might also need it.
Can you make it so that when all the players are close the camera doesn’t zoom in too far? Because it zooms in way to much when all the players are close.
Yeah, and actually it’s not perfectly how I want it, I’ll change it in a while, but now I gtg
Ok, I’ll make a zoom limit for each
Oh okay, Bye!
Nice.
You can just use filters yourself
Unfortunately I don’t know where to put the filters.