Rigidbody2d.moveposition not working on gameobjects with children.
I have a player game objects with children. I am attempting to move this player in the x axis by using the recommended function Rigidbody2D.MovePosition. I have also tried Rigidbody2D.AddForce and neither work in player. The player has children to animate them separately.
Answer by theindiandood · Feb 01, 2016 at 11:45 PM
I just solved this. Vector2 and Vector3 variables for some reason don't set in void Start(). Use void Awake(), Void Update(), or Void FixedUpdate().
Your answer
![](https://koobas.hobune.stream/wayback/20220612062625im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
myRigidbody.MovePosition influences the force. 0 Answers
How do I make Polygon Collider 2D more smooth? 0 Answers
Delete the parents and give the children an rigidbody 0 Answers
Rigidbody.MovePosition velocity curve 0 Answers
Moving a rigidbody in local space with transform.TransformPoint has unexpected results. 1 Answer