News Forums RAIN General Discussion and Troubleshooting Characters walk through terrain.

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

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #34914

    bigfiregames
    Participant

    Hi all,

    I have a 1000 by 1000 terrain with a 1000 by 1000 RAIN navmesh

    a few enemy AI characters who seem to ignore the navmesh and do what they please.
    Sometimes they walk right through the terrain, sometimes they walk right ibto the sky ending up miles above the terrain.

    my AI have the following.

    -A capsule collider.
    -RigidBody
    |_use gravity is checked
    |_is kinematic is checked.
    |_all restraints are checked except position on the Y axis.

    I have a behavior tree which is set up to wander to random points on the map.
    If the enemy AI sees the player at any point it gives chase until it catches the player or loses sight of the player at which point it begins to wander again.

    I have my movement set up so that my AI rotates towards the next random spot and sets a float in mecanim to animate the characters rig. I am using root motion to actually move my AI character across the terrain (could this be the problem)?

    in the RAIN mecanim tab I have the following:

    allow 3DMovement is checked
    allow 3DRotation is checked
    allow off graph movement is not checked.

    Use root motion is checked
    override root motion is checked.

    Can anyone spot anything obvious?

    EDIT: I removed the rigidbody and unticked apply root motion in my animator component and the RAIN AI component and there is still no change so I don’t believe the problem lies with root motion.

    my AI guy just glides over vallys and runs through hills…..

    • This topic was modified 6 months, 3 weeks ago by  bigfiregames.
    #34917

    prime
    Keymaster

    You don’t want IsKinematic to be checked. You don’t want allow 3d movement or allow 3d rotation. If you have use root motion checked on the motor, then RAIN isn’t transforming the body at all.

    I suspect that the problem is a combination of Allow 3d rotation and Override root motion rotation.

    #34919

    bigfiregames
    Participant

    Thanks Prime, I’ll give it a try.

    #34927

    bigfiregames
    Participant

    Ok so I added I unticked is kinematinc and allow 3d movement and rotation and now my character won’t move.
    I think it’s probably best if I just send it you in a project file.

    /Paul

    #34938

    prime
    Keymaster

    The floating problem ended up being that the Animator is set to Root Motion, but the animations themselves are not root motion animations. Plus the Root Motion was conflicting with the physics constraints - my bad, when you use Mecanim Root Motion for movement you have to get rid of the constraints.

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

You must be logged in to reply to this topic.