Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope position delay from parent
#12
(16-05-2018, 05:43 PM)VirtualCucumber Wrote: It sill falls behind Triste

This is what I have:
Code:
//Solver declaration, assigned through editor
public ObiSolver solver;

public void Start()
   {
       solver.OnStepBegin += Move;
   }

public void Move(object sender, EventArgs e)
   {
       //Movement
   }

Just double checked your movement code. It seems that you're moving things around by setting the velocity of a rigidbody, instead of the position of a transform. This velocity is added to the rigidbody during FixedUpdate, at which point the rope has already been simulated, introducing a 1-frame delay.

Simply apply the velocity to the transform yourself. You don't even need a rigidbody (you're not using it at all). Do this:

Code:
transform.position += velocity * Time.fixedDeltaTime;

instead of

Code:
rb.velocity = velocity;
Reply


Messages In This Thread
RE: Rope position delay from parent - by cubrman - 15-05-2018, 08:02 PM
RE: Rope position delay from parent - by josemendez - 17-05-2018, 09:05 AM