Hi,
I am developing an Android game at the moment and I have started doing some tests on different devices. At first I believed that this was a viewport issue but upon returning to the Editor for some more tests I have come across this issue.
The x component should be in a multiple of 1280 and using the 16:10 Landscape preset, this is true. Across other presets however it changes.
For example
Also, the Z keeps changing but this isnt a problem
This is the code that handles the movement of the object in question
CharacterCreation.transform.position = new Vector3(Mathf.Lerp(CharacterCreation.transform.position.x, (-characterIndex * 1300), Time.deltaTime * 5), 0, 0);
if (CharacterCreation.transform.position.x <= (-characterIndex * 1280) && goNext)
{
CharacterCreation.transform.position = new Vector3(-characterIndex * 1280, 0, 0);
Debug.Log(CharacterCreation.transform.position);
isTransationing = false;
}
else if (CharacterCreation.transform.position.x >= (-characterIndex * 1280) && !goNext)
{
CharacterCreation.transform.position = new Vector3(-characterIndex * 1280, 0, 0);
Debug.Log(CharacterCreation.transform.position);
isTransationing = false;
}
groundtempthing.transform.position = new Vector3(Camera.main.transform.position.x, -95, 0);
It says 1300 in the first line to get it over the 1280 multiple threshold, otherwise it never reaches it for some reason.
Anyway, just to reiterate,
- Moving an object in multiples of 1280
- Doing so at 16:10 Landscape moves it correctly
- Doing so at any lower ratio or resolution causes it to fall short or over shoot
If I have missed anything that might help you help me, let me know, thanks