Does not work on WebGL on IOS 15
Anthony Any progress on this?
- Edited
Yes, indeed this was broken,
Here is a quick fix, if you don't want to wait for the update, you just have to define the finalOffset variable
in CameraTopDownOrtho.cs:
override protected void Init()
{
base.Init();
finalOffset = transform.position.SetY(0);
finalPosition = transform.position.SetY(fixedDistance);
finalRotation = transform.rotation = CalculateInitialRotation();
}
In CameraPerspective.cs:
override protected void Init()
{
base.Init();
currentPitch = Pitch = initialRotation.x;
currentYaw = Yaw = initialRotation.y;
finalOffset = transform.position.SetY(0);
finalRotation = Quaternion.Euler(currentPitch, currentYaw, 0.0f);
finalPosition = CalculateNewPosition(finalOffset, finalRotation, finalDistance);
}
Keep me posted, thanks!
- Edited
This makes no difference.
The code in CameraTopDownOrtho.cs does not compile, "CameraTopDownOrthoEditor.cs(11,33): error CS0115: 'CameraTopDownOrthoEditor.Init()': no suitable method found to override" But I dont use Ortho yet.
The code in CameraPerspective.cs compiles, but when it's run, initialRotation is (0,0) so it's not taken from the camera.
Mind you, in line 15 it says "public Vector2 initialRotation= new Vector2(0,0);"
Kulitorum
Well, Disabling the "Camera Top Down Ortho" script form TouchCamera fixes it, and then it works.
Hmmm, but then I get an error in cameraorthobase.....
Ah, scratch the earlier comment about "CameraTopDownOrtho" - I pasted it in CameraTopDownOrthoEditor.cs
Still don't work though.
Ok, I reimported everything, including Lean.
I replaced the init functions.
I then select the "TouchCamera" (only camera in my scene) and move it to:
-3.26, 10.35, -6.03
35, 38.19, 0
1,1,1
And play.
Result:
-3.259782, 7.633153, -16.9334
35,0,0
1,1,1
So I load your demo, "Camera Modes/Perspective_Only_Demo"
Select the "TouchCamera" and move it to:
10,10,10
30,30,0
1,1,1
And play. Same result, camera is at:
10,5.73, 1.0
35,0,0
1,1,1
Can you please fix it?
kulitorum
I understand your point, basically right now, the transform position is used as offset in the plugin, and the "init rotation" variable is taken from the camera component parameters, instead of the transform rotation.
What you request is to keep the exact same transform (position+rotation) and convert it to the plugin's settings at start.
I will work on that and keep you posted!
Thanks!
So is there any way I can hack it in the meantime? - I just want my initial view to look good, that's all.
Can I setup the start viewport somewhere else?
Thank you.
- Edited
kulitorum I understand, then on the camera's component, locate the "initial rotation" parameters and edit them, for example if you're using CameraPerspective mode :
You can also change the init distance :
this is the distance between the camera view's center point on the ground and the camera along the it's z axis.
then you will have to change the camera's Transform position, it will be applied as the "offset" setting. The offset is the camera view's center point position on the ground.
I agree it's a bit tricky, so you're point makes complete sense, I'll work on that asap.
Thanks!
With this information I got to a usable result.
Thank you.
If you are updating the script, can you add a function to move the Y coordinate of the camera? - Like a mode where you move the camera target in a plane perpendicular to the camera view vector (camera->target) ?
Thank you
The preview version you emailed me works a lot better.
Thank you.