News Forums RAIN General Discussion and Troubleshooting Character sinks into the ground!

This topic contains 9 replies, has 2 voices, and was last updated by  prime 2 months, 2 weeks ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #34680

    rainingrick
    Participant

    I have a NavMesh (max Slope = 0, walkable height = 2, walkable radius = 0.55, step height =0.75etc)

    I have a character.
    My character has a behaviour tree such that it will follow a waypoint route
    Oddly, my character sinks into the ground as it walks!

    Any ideas?

    #34692

    prime
    Keymaster

    Do you have a capsule collider and rigidbody set up on your character? Or a unity CharacterController?

    #34705

    rainingrick
    Participant

    I have the following object structure.

    Character (has Animator Component and IKProxy
    -> Model (has Mesh renderer)
    -> AI (has AI Rig with behaviour tree etc)

    So my character doesnt have a collider, rigid body or character controller.

    Should it?

    #34708

    rainingrick
    Participant

    I’ve added a character controller, but my character still sinks as he walks around.

    He sinks up to his waist, but never any further!

    The waist corresponds to the center of the character.

    #34709

    rainingrick
    Participant

    My ground has a box collider.

    When adding a capsule collider and rigid body to my character, its motion becomes erratic - it topples over.

    #34712

    prime
    Keymaster

    Set constraints on the rigid body - freeze in X/Y/Z rotation and X/Z position

    #34766

    rainingrick
    Participant

    Continued to get odd movement!

    I watched this video (https://www.youtube.com/watch?v=YuaBBCL5PSs#t=11) and there doesn’t seem to be any character controller or rigid body used here?

    Could it be a problem with the nav mesh?

    I’ve also noticed that the minute I add a rigid body and character controller my character starts to get stuck a LOT!

    As a bit of background, I’m generating my NavMesh based on the code in this example: http://rivaltheory.com/wiki/rainelements/navmeshrig

    The general setup is:

    NavMesh
    I have several obstacles.

    My character has a behaviour tree which has a waypoint patrol variable which is set via

    aiRig.AI.WorkingMemory.SetItem<string>(“patrolRoute”, patrolName);

    The character set up is:

    Character

    Is there anyway to get source code so that I can debug!

    • This reply was modified 2 months, 2 weeks ago by  rainingrick.
    • This reply was modified 2 months, 2 weeks ago by  rainingrick.
    #34769

    rainingrick
    Participant

    In fact, even when removing the obstacles, the character gets stuck!

    Heres what the NavMesh looks like.

    navmesh

    The characters are all placed within a green section

    #34770

    rainingrick
    Participant

    Adding a Capsule collider has helped and using a basic motor on the AI has helped.

    So my character now has a rigid body and a capsule collider and a controller and uses the basic motor)

    The character isnt getting stuck anymore….but the characters Z position jitters quite a lot.

    I only have a flat plane (and will never need vertical motion)!!

    Arghh!

    • This reply was modified 2 months, 2 weeks ago by  rainingrick.
    #34773

    prime
    Keymaster

    You really don’t want to use a Character Controller and a rigid body/capsule at the same time. You’ll want one or the other. If you stick with the CharacterController, make sure you switch to a CharacterControllerMotor. If you go with the rigid body/capsule then you should use the BasicMotor.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.