Need help with Camera stopping at the right time

I am learning Paper2D by recreating parts of Castlevania for the NES.

While doing this it appears that I can’t really figure out how to make the camera work correctly. It needs to stop following Simon at a certain point so that he can walk to the edge of the screen without being followed in both Left and Right directions.

But I don’t know how to do that. I am currently using the default 2D Character setup from the 2D Scroller example.

9f0d10b6bd.png

I made one modification to the camera which you can see below. The modification makes the camera not follow Simon in the Z Axis:

Add a “clamp” node that clamps the X value of the vector to the minimum/maximum X coordinate you want the camera to be able to move to.

You can also use camera blocking volumes and use sweep when moving the camera. This would work best if camera was an independent actor.

Clamping would be much easier however if your level is only going to be left/right and not mult-story

I tried to use the Camera Blocking Volume but nothing happened. The camera just goes right through it. I think I’ll try the clamp method.

So now the camera stops at the right place but it doesn’t make Simon able to re-center the camera when he walks back again.

I’m toying around with paper2d at the moment too so thought I’d have a quick go.

This works for me (clamping method):

Apologies, that was only limiting the upper x.

This clamp should work ok though: