Camera+ Example - JR01

wait, actually the camera completely unlocks if you add two different directions it can go in

1 Like

You have to name the cam-bounds objects correctly.

A1 and A2 are correct, but you have 2 B2 objects and a B3 and one that’s not named.
You need A1, A2, B1, B2, C1, and C2 as the object name.

2 Likes

oh, i just realized, thanks!

1 Like

Update 11/30/22:

  • Replaced the “On/Off” input with “Modes” input.
  • Added a Room output on the bundle.
  • Changed the Level layout.
  • Changed player and camera start position.
  • Changed example Remove to where you can remove the current room.
  • Changed example Re-Add to re-add all rooms that are removed.
  • Updated Game Description.

Modes:

  1. Follow Room layout and off-bound areas (Default)
  2. Disable off-bound areas (Stops at last room)
  3. Always Center Target (Ignore all areas)
  4. Check Activation (mode 2)

Thanks to @Greggo for suggesting a way to disable off-bound areas. And with some other ideas, I’ve changed the “on/off” input into “Modes”. Mode 1 is default, Mode 2 is the same but doesn’t center the player when outside the rooms. Mode 3 is how no/off worked before and just moved the camera to the target position. And Mode 4 is one I added last minute, where the camera will only change rooms when you input 4 into Mode (like a manual check).

I also added it to where the Room Letter always outputs from the bundle, so you can make changes depending on what room the player is currently in. Like in this example, you can now use R to remove the Room you are currently in to show off the functionality. But also for simplicity, you can press T to re-add all the removed room. Whenever the target is outside the rooms, the bundle will output “Out of Bounds”. If the Camera is in Mode 3 (ignore all areas), the bundle will always output “Out of Bounds”.

I also made a few edits to the map for easier testing.
If you have any bug reports, suggestion or thoughts, let me know.
https://flowlab.io/game/play/2117959

5 Likes

Just started using this on one of my games and it works so smoothly
this example is so amazing

@JR01 quick question, will changing the parallax of the camera mess up the system at all?

Parallax should not be connected to the camera system.

2 Likes

The parallax is set to 0. I’m wondering if changing it would mess up how it works.
image

What I meant was that the Parallax is not going to affect anything because it’s just the parallax. Parallax effects are just in the background and should have no effect on foreground objects. They should not effect anything with how the camera follows the player because they are 2 separated systems.

2 Likes

Small update,
The camera bounds are marked as A to Z for 26 zones. But for some users 26 zones is not enough, so I made it now from A to ZZ for 702 zones. Where after using zone Z, it starts as AA, AB, AC, etc.

12 Likes

So good; I have to start using this too!
Incredible work, and if that update was needed, it’s a good sign that people are using it :ok_hand::sparkles:

5 Likes

Small Update

  • Smooth overlapping Transitions
  • Fixed sorting lists bug
  • Cleaner code

I’ve been slowly updating this example depending on requests and bug reports. This example can now handle bounds that overlap and automatically change to the newest room in crossing the overlap. So now the character doesn’t have to be off-screen for the camera to move to the next room (but will if you turn around while in the overlap area). As well, there was a small bug that varied game to game but was mostly hidden. So if you have any issues with this system and it just breaks when importing or when playing on mobile/slower devices or maybe it just fixes on reload, this should be fixed now.

Also a tip, if you have a lot of overlapping areas or having issues with rooms being next to each other, try making triggers to delete and re-add the room letters with the remove and re-add inputs on the bundle.

5 Likes

Just asking, will it work for teleporting?

From what I know of the example it should have no problems handling teleporting

1 Like

Hmm the camera will ease anywhere you teleport to, but it itself does not teleport.
I may look into adding over right inputs so teleporting the camera itself would be possible.

So to answer your question, yes it will work but it will just chase the player wherever you teleport to.

I’m making an rouge like with room of various sizes. The player teleports from one room to another and I want it to seem like it is all connected.

@JR01
I am applying this camera concept to my game. It doesn’t work and I don’t know why. If you want the link, I’ll have to privately send it. Please help.

1 Like

PM me the link and the object names for the camera, the camera bounds and the levels they are in and i will look at it tomorrow.

2 Likes

Ok, thank you very much. (Never mind. My team and I solved it.)

1 Like

Update 1/29/2024

  • Cleaned up the code
  • Added Move Camera inputs (teleport camera)
  • Optimized Some code
  • Updated the Cam Bound Objects (!)

I spent last night redoing the camera+ code to clean it up and remember how it works overall. I can more easily add features to the bundle now, so expect more sooner than later. Now you can teleport the camera if you are using a single level for multiple maps, using the MovX and MovY inputs. I also redid the Camera bound objects to simplify to code more, So if you use this new camera bundle to ALSO copy the new cam bound objects. You can set speed to 100 to teleport between rooms like the old Zelda style, but MovX and MovY is added so you can keep the same camera speed but move the camera to the next area you need (need to know where to send the camera when you teleport the camera and player).

8 Likes