- Home /
transform position to moving object too slow
Hello, cube object in fixed update has position transform to sphere object. If sphere is not moving, cube is inside sphere but if sphere is moving by physic, cube can not keep up. How can I make cube always inside sphere independently of speed of sphere?
Answer by JVene · Aug 23, 2018 at 07:52 PM
Checking this documentation (scroll down to the diagram), you'll note that the internal physics update happens after the FixedUpdate function is called. That's why the cube is always behind.
If there are reasons the square isn't a child of the sphere, or connected to the sphere through a fixed joint (both of which would keep the two objects synchronized during physics calculations), you'll have to run a check that is known to be outside this order of events.
It would appear that 'time' could well be in Update.