Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Moving Platform
#3
Admin Edit: Added code formating.

Hello again,

Checked both scenes, the setup is similar, but was not able to resolve the issue with any of the information i got from these scenes.

I have tried the tangent direction suggestion. It is slightly better, but still the same.

With tangent, the issue appears to be everytime we are nearing a point
With "Position" velocity, it seems that the issue is only present when the spline changes Direction from forward to backward and vice versa.



My code is as bellow.


Code:
float speed = controller.Speed;

if (controller.MovementDirection == MovementDirection.Backward)
speed *= -1;

Vector3 tangent = controller.Spline.GetTangent(controller.RelativePosition);

currentVelocity = tangent * speed;


I have also created a new game object with a script as bellow in order to ensure nothing from my players code creates the issue.

Code:
public class TestSplinePlatform : MonoBehaviour
{
   
    public Rigidbody rb;

    public SplineMovingPlatform splinePlatform;

    public bool addForward;

    private void FixedUpdate()
    {
        Vector3 direction = Vector3.zero;
        if (addForward)
        {
            direction = transform.forward;
        }
        direction += splinePlatform.currentVelocity;

        rb.velocity = direction;
    }

}


Issue unfortunately persists, when splineController nears the next point, there is some jingle/jitter behaviour on the rigidbody.

My Camera runs on LateUpdate
Have tried messing with the script priority order. Nothing worked.
Rigidbodies Interpolate is set to Interpolate for both the rigidbody of the splinecontroller and the player.
Have tried non and extrapolate, did not work

Any other suggestions?
Reply


Messages In This Thread
Moving Platform - by Kokoriko49 - 09-06-2024, 04:48 PM
RE: Moving Platform - by _Aka_ - 09-07-2024, 02:41 PM
RE: Moving Platform - by Kokoriko49 - 09-10-2024, 03:55 PM
RE: Moving Platform - by _Aka_ - 09-11-2024, 09:23 AM
RE: Moving Platform - by Kokoriko49 - 09-19-2024, 09:51 AM
RE: Moving Platform - by _Aka_ - 09-20-2024, 07:54 AM
RE: Moving Platform - by _Aka_ - 09-20-2024, 04:20 PM
RE: Moving Platform - by Kokoriko49 - 09-22-2024, 08:27 AM
RE: Moving Platform - by _Aka_ - 09-23-2024, 09:20 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Moving object down or up the spline using gravity velikizlivuk 6 4,056 07-26-2023, 10:06 PM
Last Post: _Aka_
  how to make fast moving controller go all the way to linear points?(curvy8) hawken 7 4,922 06-06-2023, 09:47 AM
Last Post: _Aka_
  Obstacle Moving Along the spline Chanon 1 1,811 06-13-2022, 04:13 PM
Last Post: _Aka_
  Possible to jump from platform to platform with Curvy splines? yun844 1 1,606 01-04-2022, 11:47 AM
Last Post: _Aka_

Forum Jump: