Hi there people! First time using this asset and I'm amazed, congrats by the hard work Anthony!

I was trying to achieve a more softer movement when using the FreeCamera and tried using the inertia options but it's not working very well for me (or at least I don't know how to properly configure the fields to create the correct output from the maths)

I would like to get the effect of a "Lerp", more like the camera from places like Sketchfab does, which has inertia but also stops its movement very slowly but firmly. Check this out for example: https://sketchfab.com/3d-models/spiderman-toy-style-a40e20a288004a83be30dc155bba20f9

Thanks!

    Roskaxapas Hi!
    Thank you! The inertia in Touch Camera Camera is happening when you release, not when you drag. You can check the inertia demo scenes to try out.

    The demo you are showing could be done with a simple orbiting camera more easily, as Touch Camera is more a precise camera, there is no lerp effect during the input.

    I can add that on my todo list if you are interested.

      Thanks for the quick reply Anthony!

      The orbit-type camera is a good point but I'm not looking for that kind of camera but more a free one like the one you created, which as I said before, it's already amazing (I know it has a lot of work and maths behind the schemes).

      I'm just looking a way to add that kind of smooth damping at the end. I know it would kill the precision but it something I can accept for the project im working now.

      Thanks for the offer, it would be great if you could include that "smooth damping", or maybe you can point me in the right direction and I can try to add it by myself.

      Thanks again, keep it up man

        Roskaxapas Ok I understand. Adding damping is a bit tricky on TouchCamera, as the position depends on the rotation, and everything is driven by the touch inputs/mouse precisely. You can try to edit CameraBase => GetRotationFromPitchYaw like this:

            protected float dampedCurrentPitch;
            protected float dampedCcurrentYaw;
            public float rotationDamping = .02f;
        
            virtual protected Quaternion GetRotationFromPitchYaw()
            {
                if (dampedCurrentPitch == 0) dampedCurrentPitch = currentPitch;
                if (dampedCcurrentYaw == 0) dampedCcurrentYaw = currentYaw;
        
                dampedCurrentPitch = (Mathf.Lerp(dampedCurrentPitch, (currentPitch), rotationDamping));
                dampedCcurrentYaw = (Mathf.Lerp(dampedCcurrentYaw, (currentYaw), rotationDamping));
                return Quaternion.Euler(dampedCurrentPitch, dampedCcurrentYaw, 0);
            }

        In CameraFree.cs replace these lines

                        currentPitch = NormalizeAngle(finalRotation.eulerAngles.x);
                        currentYaw = (finalRotation.eulerAngles.y);

        by

                        currentPitch = dampedCurrentPitch = NormalizeAngle(finalRotation.eulerAngles.x);
                        currentYaw = dampedCurrentYaw = (finalRotation.eulerAngles.y);

        That is working perfect! Thanks a lot for that Anthony ❤️

        Besides, using 1 as rotationDamping keeps it working as before so it's a nice solution, you might want to include it in case other users want the feature as well.

        PS: I've seen the code for the FreeCamera is commented and there are things that looks like temporal, are you still working on it?

          Roskaxapas yes this free camera script is still a beta mode, with some issues to solve 😉

          Thanks for your feedback

          Write a Reply...