- Home /
Question by
darkmon54 · Jan 01 at 08:12 AM ·
cameracamera-lookmoving platform
moving platform camera fix
hey im dark!~ so i have this moving platform script in my fps game where whenever my player is attach to the moving platform i would get drag along with it making the fps camera glitch and sort of gets behind or front (wherever the platform is moving towards) like this
as you can see my player gameObject is a parent of other gameobject like the 3D capsule,ground check,camera position (which is empty its just where i put my main camera in through script and arrange it for a fps) and orientation, and heres my movingplatform script
public class movingplatform : MonoBehaviour
{
public GameObject player;
private void OnTriggerEnter (Collider other)
{
player.transform.parent = transform;
}
private void OnTriggerExit (Collider other)
{
player.transform.parent = null;
}
}
moving-flat-glitch.png
(483.3 kB)
moving-flat-glitch-2.png
(425.5 kB)
Comment
Check the script which changes the camera position. Perhaps the way the camera moves is what cause the problem (like using Vector3.Lerp, Vector3.SmoothDamp,....)
Your answer
![](https://koobas.hobune.stream/wayback/20220613051134im_/https://answers.unity.com/themes/thub/images/avi.jpg)