- Home /
Scaling problem of child or Player on Moving Platform
Why is it happening with the shape of the player or scale of the player. As soon it player become child of the platform the scale of the player is changed and when exit the platform it again become normal. This is the worst bug i saw. No tutorial on YouTube regarding this problem. Please help. It is really frustrating.
Answer by Glaas · Jun 09, 2020 at 09:16 PM
Hiya ! Could you share what you see more in detail, for example with a screenshot or a video ?
Just in case, the problem could come from your hierarchy ; when an object is a child of another object, any modifications of the parent's Transform will also affect the children.
Maybe try unparent the gameobject that causes issues ?
Answer by tuinal · Jun 09, 2020 at 11:48 PM
The non-script lazy 5 second solution is add an empty child to the platform, scale it up, and attach the player to that instead.
A gameobjects transform inherits from its parents - not a bug. This is what you're exploiting to have the player move with the platform (inherited position), but also what's causing the problem (inherited scale).
It is better to get in the habit of not scaling object transforms in Unity, unless it's for a very specific effect. Instead, import at unit scale (either by exporting correctly, or changing import settings for the asset). Trying to use Unity as a budget 3D modelling or 2D art package by being creative with transforms isn't what it's intended for and can easily make scripts & workflow broken or messy which is what you're experiencing.