Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdjustCameraOnRoomLoad doesn't seem to work as expected #6

Closed
tarnos12 opened this issue May 2, 2022 · 5 comments
Closed

AdjustCameraOnRoomLoad doesn't seem to work as expected #6

tarnos12 opened this issue May 2, 2022 · 5 comments

Comments

@tarnos12
Copy link

tarnos12 commented May 2, 2022

In game_start I have:
Rellax.AdjustCameraOnRoomLoad = true;

When moving to a different room the camera moves on y axis a bit(from bottom to top)
I am not sure why, is there a way to make it snap to the "end position" on room load?

I am changing room like so:
player.ChangeRoom(1, 1000, 500);
player.ChangeRoom(2, 2000, 1500);

Once I go to the room 2, camera still moves upwards after fade in.
How would I force the camera to reach the end position on room load?

After all this, I tried adding these lines of code which did not help.

Rellax.CameraWindowHeight = 1080;
Rellax.CameraWindowWidth = 1920;
Rellax.CameraOffsetX = 0;
Rellax.CameraOffsetY = 0;
Rellax.CameraLookAheadX = 0;
Rellax.CameraLookAheadY = 0;
@tarnos12
Copy link
Author

tarnos12 commented May 2, 2022

The function _quickAdjustToTarget is giving the correct position and it seems to set the camera correctly, but some other code is still forcing the camera movement(basically ignoring this part of the code, or overriding it)

Seems like doSmoothCameraTracking is the one responsible for changing the position of the camera even if the camera should already be at the end position.

So basically what I would like is a way to call doSmoothCameraTracking, but ignore the smooth transition and go to the end before room fade in.(I guess there is a variable responsible there to do that, or the camera is always at an offset(this offset should be applied in _quickAdjustToTarget)

@ericoporto
Copy link
Owner

ok, I found the issue, it's neither of those, it's the roomsetup of the parallax stuff. I am making a new update. 0.2.2 soon

@ericoporto
Copy link
Owner

ericoporto commented May 2, 2022

made a new release! Please check! The camera update should be instant if Rellax.AdjustCameraOnRoomLoad = true - this is the default, so if you never changed this property, it will work too!

@tarnos12
Copy link
Author

tarnos12 commented May 3, 2022

Works great, thanks!

@ericoporto
Copy link
Owner

Cool! I am closing this then. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants