Post by kalmiya on Mar 29, 2020 11:00:29 GMT
I have a long flat level (2d parallax platformer, much open space, no real 'rooms'), where at some point I'd like the camera "TopPosition" to be limited.
- on the left/right sides of the level you can jump, and the camera moves up with you
- in the center there is a (long) stretch where you can jump, but the camera should not move up with you.
Wanted to achieve this effect using Trigger Boundaries, but those have some limitations. My initial idea was the following:
- Set the camera to have a Trigger Boundary on the edges of the level ( except top ), for generally limiting movement to be inside the level.
- Add a trigger-volume stretching over the entire center-part of the level, setting only the top-boundary-value (leaving the other untouched).
Observations:
1. When entering the volume, left/right/bottom are disabled. I understand why that happens ( the trigger volume sets top, so the others get overwritten to 'not used' ), which is not what I expected.
2. When leaving the volume, the left/right/bottom remain disabled ( and top remains enabled). I expected it to revert back to the previous values.
The first issue can be avoided by using "global/level" trigger boundaries - and use a geometry boundary around the level instead.
The 2nd issue would need more trigger area's (one before, one after - setting back the top to unused) and possibly those can be skipped ( no rooms forcing the player through a narrow part ).
It's not a huge deal, but if the trigger would only change what is needed and revert back on leaving (to the previous setting on the stack) the system would be simpler to use.
- on the left/right sides of the level you can jump, and the camera moves up with you
- in the center there is a (long) stretch where you can jump, but the camera should not move up with you.
Wanted to achieve this effect using Trigger Boundaries, but those have some limitations. My initial idea was the following:
- Set the camera to have a Trigger Boundary on the edges of the level ( except top ), for generally limiting movement to be inside the level.
- Add a trigger-volume stretching over the entire center-part of the level, setting only the top-boundary-value (leaving the other untouched).
Observations:
1. When entering the volume, left/right/bottom are disabled. I understand why that happens ( the trigger volume sets top, so the others get overwritten to 'not used' ), which is not what I expected.
2. When leaving the volume, the left/right/bottom remain disabled ( and top remains enabled). I expected it to revert back to the previous values.
The first issue can be avoided by using "global/level" trigger boundaries - and use a geometry boundary around the level instead.
The 2nd issue would need more trigger area's (one before, one after - setting back the top to unused) and possibly those can be skipped ( no rooms forcing the player through a narrow part ).
It's not a huge deal, but if the trigger would only change what is needed and revert back on leaving (to the previous setting on the stack) the system would be simpler to use.