Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Moving Platform
#1
Hello,

I have the following setup.


Box with splineController that moves along 2 points in ping pong.

A script with which i get the velocity of the box with the bellow snip.

currentVelocity = (transform.position - previousPosition) / Time.deltaTime;
previousPosition = transform.position;

Then I add this velocity on my rigidbody after the i have set the its own movement velocity.

This works ok, until we are very near the next point, at which case, the rigidbody is pushed and displaced slightly.

I had the exact issue with using a custom rigidbody moving platform, but i resolved it by setting the execution order of the moving platform script to be lower than the players rigidbody.

I have tried all possible combinations, or at least most of them in terms of: getting the velocity in fixed update,update or late update, have the Target Component on Spline controller in rb and transform, locked rotations, etc.

I suspect is there is a component that runs the movement of the spline which runs after my players.
Or, that the controller snaps to end position when close enough.

Any ideas or guidance is appreciated.

Thank you in advance,
Kokoriko49
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,083 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,934 06-06-2023, 09:47 AM
Last Post: _Aka_
  Obstacle Moving Along the spline Chanon 1 1,812 06-13-2022, 04:13 PM
Last Post: _Aka_
  Possible to jump from platform to platform with Curvy splines? yun844 1 1,614 01-04-2022, 11:47 AM
Last Post: _Aka_

Forum Jump: