Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lerp Movement on Circle Spline
#1
Hello.

I'd like to know if I can Lerp the movement of my game object on a circular spline? On my web and machine builds - the movement is smoother than on my Android device. I am lead to believe this has something to do with the way Unity handles the inputs on mobile devices compared to desktops (but I could be wrong).

I am using a fairly old version as it is for a fairly old game (but I do not want to update the package because of the change I have made to the scripts etc.). However, I am sure that the movement code can be changed to allow this to happen but I am unsure as to which part of the script I need to change.

Below is the code that was in the script when I started using it. I have only changed the script elsewhere to work with my touch input. I am using movement by world units.


Code:
if (MoveByWorldUnits) {
               // either used cached values(slightly faster) or interpolate position now (more exact)
               // Note that we pass mTF and mDir by reference. These values will be changed by the Move methods
               mTransform.position = (FastInterpolation) ?
                   Spline.MoveByFast(ref mTF, ref dir, Speed * Time.deltaTime, Clamping) : // linear interpolate cached values
                   Spline.MoveBy(ref mTF, ref dir, Speed * Time.deltaTime, Clamping); // interpolate now
           }
           else { // Move at constant F
               // either used cached values(slightly faster) or interpolate position now (more exact)
               // Note that we pass mTF and mDir by reference. These values will be changed by the Move methods
               mTransform.position = (FastInterpolation) ?
                   Spline.MoveFast(ref mTF, ref dir, Speed * Time.deltaTime, Clamping) : // linear interpolate cached values
                   Spline.Move(ref mTF, ref dir, Speed * Time.deltaTime, Clamping); // interpolate now
           }

Thanks.
Reply


Messages In This Thread
Lerp Movement on Circle Spline - by g0tNoodles - 09-27-2015, 08:22 PM
RE: Lerp Movement on Circle Spline - by Jake - 09-28-2015, 07:27 AM
RE: Lerp Movement on Circle Spline - by Jake - 09-29-2015, 01:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 1 1 Yesterday, 10:12 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 2 Yesterday, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 13 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: