playMaker

Author Topic: Help with character controller issues...  (Read 2059 times)

cmonroy

  • Playmaker Newbie
  • *
  • Posts: 34
Help with character controller issues...
« on: November 01, 2014, 05:06:02 PM »
This is not really a problem related to Playmaker per se, but maybe the community can provide me with their suggestions about how to solve it.

Is a simply setup: some skinned mesh with a character controller, a rigid body, an animator controller and FSM to provide the Horizontal and Vertical axis values to the animator in order to produce locomotion. The animations are taken from one of the Unity Tutorials and include a WalkBack, WalkBackLeft and WalkBackRight animations.

I added a Grounded check and noticed that when Walking Backwards, IsGrounded is false and switching between true and false with all other animations. The character mesh is 1.70 meters tall, so its center is at 0.85 meters, and all objects are zeroed and sitting flush to the ground. I hit play and the character jumps up about 5 centimeters, so I move the center of the character controller until the mesh no longer falls trough the plane floor but its feet are touching the ground. This solved the looks, but as the IsGrounded check still is false, the character falls when trying to Walk Back. A capsule collider instead of a character controller gives me the same problem...

I've checked the character meshes and the animations, used others and still have the same IsGrounded problem. Any ideas?

Thank you.

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Help with character controller issues...
« Reply #1 on: November 02, 2014, 01:47:54 AM »
I've had similar problems with Isgrounded- what I had to do was use a combination of the Isgrounded action and a raycast being fired from one of the characters feet measuring the distance from the "floor" layer and itself- and using that to set a "grounded" bool variable.

So I use Isgrounded as an initial check than it goes to the raycast to really make sure its grounded or not- I use those to set a bool named "grounded"
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

cmonroy

  • Playmaker Newbie
  • *
  • Posts: 34
Re: Help with character controller issues...
« Reply #2 on: November 06, 2014, 10:17:12 PM »
Thank you.

I've followed a similar route, but the raycast does not always detects the ground collider, so it provides me with inconsistent results as the IsGrounded does. Hence, I can't use Jumps or Falls animator states as the character keeps falling and landing every two or three steps. I'll check if using layers makes a difference.