Forum rules - please read before posting.

Player slips on moving platform.

edited October 2023 in Technical Q&A

I have a problem that appears to be a bug related to movement in the action list.

The problem occurs when jumping from one mobile tower to another, in the first tower the player does not slide with the tower movement working correctly and in the second tower the bug occurs, the player is thrown far. I reviewed the two tower objects and they are configured equally. I don't know why this problem occurs.

In the video you can see that after the player is pushed out, if he finds himself in the biggest tower, he is also thrown far away.

And in the list of actions, the actions for moving the two towers are the same, in a loop.

This game uses 2d sprites in a 3d environment. All objects have box colliders and 3d rigidbody.

Comments

  • What are your AC and Unity versions?

    It looks like there's a Collider somewhere pushing the Player - if you disable the second tower, do they still move this way?

  • It was a bug, there was no other duplicate boxcolider in the tower or around it. I deleted tower 2 and created a new tower and the bug no longer occurred. Now it worked.

    What remains is when the tower is coming down the player is bouncing on top of the rock because of gravity, in this part I don't know how to disable this.

  • I should stress that AC isn't a platform-game engine. Custom scripting / a dedicated platformer asset would be necessary for robust platform mechanics.

    See this comment by Stefan in this thread regarding the two main approaches to this issue:

    https://gamedev.stackexchange.com/questions/196887/character-bounces-when-platform-goes-up-and-down

    Here's his script, adapted for the AC Player, that you can attach to the platform (or a separate collider on the top of it):

    using UnityEngine;
    
    public class AttachChildOnTouch : MonoBehaviour
    {
    
        private void OnCollisionEnter (Collision collision)
        {
            if (collision.gameObject == AC.KickStarter.player.gameObject)
            {
                collision.gameObject.transform.SetParent (transform);
            }
        }
    
        private void OnCollisionExit (Collision collision)
        {
            if (collision.gameObject == AC.KickStarter.player.gameObject)
            {
                collision.gameObject.transform.parent = null;
            }
        }
    
    }
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.