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.
-
AuthorPosts
-
December 10, 2022 at 2:15 pm #34680
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?
December 11, 2022 at 7:30 am #34692Do you have a capsule collider and rigidbody set up on your character? Or a unity CharacterController?
December 11, 2022 at 1:26 pm #34705I 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?
December 11, 2022 at 1:38 pm #34708I’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.
December 11, 2022 at 1:41 pm #34709My ground has a box collider.
When adding a capsule collider and rigid body to my character, its motion becomes erratic - it topples over.
December 11, 2022 at 3:29 pm #34712Set constraints on the rigid body - freeze in X/Y/Z rotation and X/Z position
December 15, 2022 at 4:22 am #34766Continued 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:
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:
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.
December 15, 2022 at 5:40 am #34769In fact, even when removing the obstacles, the character gets stuck!
Heres what the NavMesh looks like.
The characters are all placed within a green section
December 15, 2022 at 5:52 am #34770Adding 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.
December 15, 2022 at 6:29 am #34773You 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.
-
AuthorPosts
You must be logged in to reply to this topic.