Search Unity

Ball falling throught up and down moving plateform

Discussion in 'Physics' started by thimblot, Aug 18, 2019.

  1. thimblot

    thimblot

    Joined:
    Jul 20, 2019
    Posts:
    2
    Hi,

    I'm having a physics issue with a ball not standing in an animated plateform, see following behavior :



    As you can see, the Ball is standing on the plateform at first, but when the animation reach the lowest point the ball is going throught the plateform.

    My MovingPlateform GameObject is a RigibBody with Kinematic checked and I setup a Box Collider too. I have a script which set the MovingPlateform as a parent of the Ball that way :

    Code (CSharp):
    1.  
    2. void OnTriggerEnter(Collider collider)
    3.     {
    4.         if (collider.gameObject == player) {
    5.             player.transform.SetParent(transform);
    6.         }
    7.     }
    8.  
    I have the same behavior whether or not I set the ball as a child of the MovingPlateform.

    Also important to notice, I'm moving the plateform without code, I'm using the animation view to do this. I first thought it was happening because it was at the end of the animation, just at the moment it's looping. But I tried to extend the animation and it's always happening...

    Do you have any idea of what I'm doing wrong ?

    Thank you
     
    Last edited: Aug 18, 2019
  2. thimblot

    thimblot

    Joined:
    Jul 20, 2019
    Posts:
    2
    I may get an idea, I think it come from the plateform around which is a Prefab initially without the central hole. I detached the central part of the plateform using Probuilder, and used this detached object as the moving plateform. But it seems that something is still blocking the way. If I place the moving plateform to another place the issue is gone.

    So detaching a part from a prefab seems a little buggy, as it's not really removed ?
     
  3. Domas_L

    Domas_L

    Unity Technologies

    Joined:
    Nov 27, 2018
    Posts:
    91
    Hello! Could you please submit a bug report with a minimal reproduction project for this issue and reply in here with the issue ID?