I have an issue with LeanTween where using LeanTween.move to move a GameObject to, for example, -1920 on the x, would actually move it to -207301.4 on the x (this is actually what’s happening to one of my GameObjects, these are not random numbers.) Does anyone know the reason why, or what I can do to fix this issue?
You’re most likely moving the position of the object when you should be moving its localPosition or vice versa. I guess you’re talking about a UI object on a scaled canvas.
Hmmmm, alright. I’ve found a workaround by just getting the component of the object’s RectTransform, and that seemed to fix it. I’m still unsure of what the problem would be though, but it seems to work fine now.
Depending on the canvas scaling mode, then depending on other modes (camera size, etc.) the base Canvas can get a super-tiny scaling, like 0.01, so that moving absolute positions in children causes massive movements like you’re seeing.
Check out your canvas’ scale, or perhaps all RectTransforms leading down from the canvas to the object in question.
Yeah, I’ve run into that with the canvas now. My workaround currently is to just use RectTransforms, but this doesn’t fix issues for other things that cannot be explicitly told to edit the RectTransform.
I’ve also switched to a World Space canvas, how would I make my canvas’ scale to 1 and still have the camera work correctly and capture the entire canvas?