Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Character walking on a giant monster, how to Implement it?

Discussion in 'General Discussion' started by lacavez_gideo, Mar 18, 2022.

  1. lacavez_gideo

    lacavez_gideo

    Joined:
    Mar 18, 2022
    Posts:
    1
    Except result:
    Shadow of the Colossus PS4: Colossus #6 Barba Boss Fight


    The problem is about collider, since character need to move on monster, capsule is not accuracy enough, need to use mesh collider.
    And monster is not a static object, it can walk, jump etc, so I need to update mesh collider every frame, which is very heavy, for example, 30K faces mesh take 18ms to update, this is unacceptable. I was think about low poly mesh, but still too expensive.

    Curious how Shadow of the Colossus implement it.
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,321
    * Mesh collider was not made for geometry that changes. The character should be colliding with convex mesh pieces or primitives the model has been split into. updating the mesh also will not provide any information about velocities so the results are going to be awful.

    * The character is attached to the model and is not colliding with it. Basically the simplest idea is to use fixed joint or spring joint to connect the character to the model. Another option is to parent him. The character movement script would be firing raycasts and the like to determine possible paths/etc. Additionally, the climbable areas could be implemented as an equivalent of "navmesh" - a "climb mesh" made out of low polys which would denote areas the character is allowed to climb. This would be a custom solution, but it can be made deformable.
     
    angrypenguin likes this.
  3. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,355
    I would use a compound collider. Try creating a ragdoll with Unity's built-in ragdoll creator and you'll see the beginnings of what I'm talking about. It's like a collection of primitive colliders acting as one.

    If you start-off with Unity's initial ragdoll, then you'll probably need to add additional colliders to fill in details of your character, but just make those children of the already-existing rigidbodies and then you wont need to add any additional rigidbodies or joints.

    Then just look up tutorials on how to implement moving platforms, because your boss is essentially a collection of moving platforms now.
     
    neoshaman and DragonCoder like this.
  4. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    550
    Walking on platforms/other moving objects is done either through parenting player to them or calculating a "platform" velocity and adding it to the player's velocity. That's putting it brutally simple, since the system needs to handle many things, like how to detect when the player attaches/detaches to the object, how this climbing code interacts with controls, camera, etc. In case of Shadow of the Colossus, I bet it wasnt some holistic system, but a number of scripts for any given interaction.
     
  5. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    There exist a post-mortem on Internet, the original was in Japanese, idk if that one is still accessible, but they have been multiple translations or blog commenting it in depth.
     
  6. TPEUnity

    TPEUnity

    Joined:
    Jan 17, 2018
    Posts:
    36