(video here:
Both the parent GameObject and the child GameObject have three components: Sprite Renderer, Circle Collider 2D, and Rigidbody 2D (set to Kinematic and Simulated). Additionally, the child GameObject has a custom component that allows it to move vertically, and the code is as follows:
public class TestBallMoving : MonoBehaviour
{
private void Awake()
{
var rb = GetComponent<Rigidbody2D>();
rb.velocity = new Vector2(0, 0.5f);
}
}
When testing, the child object moving slowly upward. However, if I continuously modify the parent’s transform (for example, the coordinates or rotation) in the Inspector panel, the movement of the child object immediately stops; while if I stop changing the transform, the child object goes on moving upward.
Furthermore, if I remove the Rigidbody2D from the parent object, then no matter how I change the transform of the parent object, the child object will continue to move as usual.
Why is this happening? I expect that no matter how I modify the transform of the parent object, the upward movement of the child object will not be affected.