- Home /
Changing the Player's parent not affecting movement
I am trying to get my 2D player to stay with a platform while it moves horizontally. To achieve this, I am trying the much talked about solution of giving the platform a child object that is essentially just a trigger collider, and then having the player's parent set to this collider using OnTriggerXXXX methods. The only problem is that the player is not moving when the platforms move, it still just slides off as the platform moves under it. I can see that the parenting is working by looking at the scene game object hierarchy while the game is running. The player is definitely becoming a child when colliding with the platforms, yet it still slides off regardless. It appears that making the player a child is having no affect on the movement of the player at all! Can anyone point me in the right direction?
Can you add some pictures of the setup of the scene and your hierarchy? Some code excerpts would also be helpful.
Your answer
Follow this Question
Related Questions
How to transform position of object A to object C (C is a child of B object) 1 Answer
How to make a 2D stairs you can walk by 1 Answer
2D Bouncing Platforms w/o Rigidbody 0 Answers
why does my player only some times go under the platform ? 1 Answer
Which should I buy if I want to make games for multiple platforms? 2 Answers