MZ How to get GALV_CamControlMZ not to follow player y when jumping

Hi everyone !

I have a script question about jumping camera offset, I'm trying to keep the camera at the base of the player rather than following him when jumping to avoid sickness motions and gain precision

I've already done it in "dragonsmoothcamera" by adding "- this._jumpY" to the cameraoffset.y line
Spoiler: screenshot
1747970245779.png

but I'm trying to get the same effect with galvcamcontrolmz because it's more fluid and having trouble doing so,

the closest I got is when adding "- this._jumpY" to that line, the camera doesn't follow the player when jumping but doesn't scroll up or down anymore

Spoiler: screenshot
1747970375405.png

any idea how I could manage this ?
Hmmm, doesn't setting a small value for scroll speed make it work almost like that? So you can check in that function you posted if player is jumping (I changed the last 4 lines):

this._scrollRest = 0;
const cw = this._camWidth;
const ch = this._camHeight;
const screenX = this.camTarget.screenX() * this.zoom.x;
const screenY = this.camTarget.screenY() * this.zoom.y;
let myCamSpeed = 0;
$gamePlayer.isJumping() ? myCamSpeed = 60 : myCamSpeed = this.camSpeed;
let sx = Math.abs(screenX - cw) / myCamSpeed;
let sy = Math.abs(screenY - ch) / myCamSpeed;


EDIT: If I understood you correctly, that you want to get rid of the delay when jumping?
EDIT2: Or was your purpose to make the camera literally stay focused on the original Y-coordinate, before jump?

EDIT3: If you want the camera to not scroll in y-direction when player is jumping and only scroll when the jump is finished, you can instead change it like:
if (screenY < ch && !$gamePlayer.isJumping()) {
this.scrollUp(sy);
} else if (screenY > ch && !$gamePlayer.isJumping()) {
this.scrollDown(sy);
};
the closest I got is when adding "- this._jumpY" to that line, the camera doesn't follow the player when jumping but doesn't scroll up or down anymore
this._jumpY does not exist in the core scripts...so I expect you're subtracting undefined, making the camera coordinate not a number.

I'd suggest this.jumpHeight() instead.

[Edit: or, like @rpgLord69 points out below, $gamePlayer.jumpHeight().]
Cool. But hmmm can you use 'this' in there? Shouldn't they reference like the $gamePlayer ? And I think they also need to put parentheses there before they multiple with the zoom.
First of all thanks for this

Hmmm, doesn't setting a small value for scroll speed make it work almost like that? So you can check in that function you posted if player is jumping (I changed the last 4 lines):

this._scrollRest = 0;
const cw = this._camWidth;
const ch = this._camHeight;
const screenX = this.camTarget.screenX() * this.zoom.x;
const screenY = this.camTarget.screenY() * this.zoom.y;
let myCamSpeed = 0;
$gamePlayer.isJumping() ? myCamSpeed = 60 : myCamSpeed = this.camSpeed;
let sx = Math.abs(screenX - cw) / myCamSpeed;
let sy = Math.abs(screenY - ch) / myCamSpeed;


EDIT: If I understood you correctly, that you want to get rid of the delay when jumping?
EDIT2: Or was your purpose to make the camera literally stay focused on the original Y-coordinate, before jump?

EDIT3: If you want the camera to not scroll in y-direction when player is jumping and only scroll when the jump is finished, you can instead change it like:
if (screenY < ch && !$gamePlayer.isJumping()) {
this.scrollUp(sy);
} else if (screenY > ch && !$gamePlayer.isJumping()) {
this.scrollDown(sy);
};

So I tried the first EDIT and u understood correctly but It didn't worked, and your EDIT3 worked but it freeze the camera when jumping and goes back to player when landing so not very smooth

this._jumpY does not exist in the core scripts...so I expect you're subtracting undefined, making the camera coordinate not a number.

I'd suggest this.jumpHeight() instead.

this._jumpY is a script call from an abs plugin so It's not in the core scripts but It worked when used in Dragonsmoothcamera to compensate the Y player camera value when jumping, I also tried this.jumpheight but it crashes "fonction non-defined"
But hmmm can you use 'this' in there? Shouldn't they reference like the $gamePlayer ?
Oops, yea. I just assumed the context based on this._jumpY. But it's a map method, so yes, it'd need to be $gamePlayer.jumpHeight().

And I think they also need to put parentheses there before they multiple with the zoom.
Good call! Specifically this line:
JavaScript:
const screenY = (this.camTarget.screenY() - $gamePlayer.jumpHeight()) * this.zoom.y;
(Not sure if that should be a + instead of a -. I didn't even look at the screenshots initially...was just focused on the _jumpY thing. 😴)
@jackass__ Like I noted (and like Caethyril edited in their post), it needs to be $gamePlayer.jumpHeight() but not sure if that's the effect you're after either? Still a bit confused what you exactly want, since your title says "not to follow player y". I tested my original solution and it works for me (meaning it has an effect, but not sure if it's the effect you're after LOL).
EDIT: Like an effect of "not-delayed" scroll, not "not follow y".
Finally found the solution, thanks again for your help !

Spoiler: screenshot
Untitled.png

Original thread: https://forums.rpgmakerweb.com/threads/how-to-get-galv_camcontrolmz-not-to-follow-player-y-when-jumping.177853/