hi i'm doing a platform where my character can hang from it and the platform moves in different directions, of course the player should move with the platform as well, currently i have some "hanging objects" and my player can hang from them but they don't move, my player compares the hanging through a LayerMask and a tag for different purposes but this is how i do it: this is how i check the hanging objects: Code (CSharp): touchingHangingArea = Physics2D.OverlapCircle (hangingAreaCheck.position, hangingAreaCheckRadius, whatIsHangingArea); and when the "hanging object is detected this is what the player does" Code (CSharp): if (touchingHangingArea && !grounded) { rBody2D.gravityScale = 0; GetComponent<Rigidbody2D> ().velocity = new Vector2 (0, 0); } Basically just turn to zero the GravitaScale of the player's rigibody, this works as i expected, but now since the platform is moving i'm trying to get the player a child of the moving platform but the player never change its gravityScale, i put this script in the child hangingCheck (which is a child of the player and the game object that i use for position of the OverlapCircle ) Code (CSharp): void Start () { playerGameObject = GameObject.FindGameObjectWithTag ("Player").GetComponent<fos_controller_script>(); playerRigibody = GameObject.FindGameObjectWithTag ("Player").GetComponent<Rigidbody2D> (); } // Update is called once per frame void Update () { } void OnTriggerEnter2D(Collider2D other){ if (other.transform.tag == "hangingOnMovingPlatform") { playerGameObject.transform.parent = other.transform; playerRigibody.gravityScale = 0; playerRigibody.velocity = Vector3.zero; } } void OnTriggerExit2D(Collider2D other){ if (other.transform.tag == "hangingOnMovingPlatform") { playerGameObject.transform.parent = null; playerGameObject.isOnHangingMovingPlatform = false; } } } The player is getting child of the platform but it never stops its velocity, for example if the platform is above the player and the the player jumps and touches the hangingArea it should stop and be hanging there like in my other hangingObjects, but it just reduces the player speed and continues with its jump!!! i don't know why is doing that, i already tried putting a collider in the player instead of a child but works the same... the player should stop there, thats it!!! any help would be appreciated thanks!!!!
Have you tried putting another collider on it that isn't a trigger? Or just changing the collider you have from a trigger to a normal collider (& change ontrigger to oncollision)?
Yes, i tried both, even with the OnCollisionEnter2D instead of OnTriggerEnter2D and the same result, it most be something of the rigibody getting child of the hanging platform that is not making it change its gravity scale, but i don't know exactly how this parent child stuff work