Experimental Character Controller package now available (formerly known as "Rival")

Wondering How to create non standard character (quadruped/spider-like) ?
seems CapsuleCollider is the only option, any suggestion?

You’re allowed to use any convex collider shape in any orientation, so in simple cases you could use a horizontal capsule, or a long box, or a custom convex collider, etc…

However in the case of horses, something fancier might be needed depending on the level of fidelity you’re looking for. I could imagine implementing these as two character capsules that are constrained with each other (one for front legs, one for back legs) so the horse can properly adjust its posture to terrain inclines or detect that there’s no grounding for only the back legs for example. This is an untested idea though, and would surely require heavy customization

1 Like

One more problem: After disabling the CC (SetCollisionDetectionActive(false), SetComponentEnabled(entity, false), RemoveComponent(entity)) I still had to remove the interpolation component RemoveComponent(entity) or else the “CC disabled, animating, not ragdolling” character would jitter. Obviously this is a temporary solution ^^

We are making a horse game and I experimented with the concept of having two constrained capsule colliders last year using Rival. I ended up moving away from this approach because of the pandora’s box of issues that will pop up once you make the horse physical. Trust me, it gets silly and annoying real fast.

We are now basing our horse’s movement on this talk
https://www.youtube.com/watch?v=8vtCqfFAjKQ
and I’m planning on doing simple casts around the horse to get information to feed to the Forward Locomotion system.

So to put it simply. The horse moves using a custom kinematic horse movement controller but the player will be using Rival.

3 Likes

How is your ragdoll setup in this case? Is it still attached to the character entity with a Fixed Joint or something similar when the character is disabled?

In the case I’m describing the npc sleeps, so it’s not ragdolling but animating. So the CC is disabled (so other people don’t collide with the air and the CC doesn’t push it out of the bed etc.), the animated GameObject part is playing an animation and the kinematic ragdoll parts follow the animated bones. Basically disabling KinematicCharacterBody does not stop the interpolation from messing with LocalTransform but (I guess) because it’s disabled it does not update the “previous position” that the interpolation uses. And because I “teleport” the npc into bed at the same time as disabling the CC, the “previous position” it uses is grossly wrong.

1 Like

Still having issues getting it to install this package. Ended up adding "com.unity.charactercontroller": "1.0.0-exp.2", to manifest.json to finally get it installed. Hopefully that’ll be resolved soon.

Hello,

Im not sure if I do something wrong but when installing com.unity.charactercontroller and com.unity.entities.graphics, i’m getting the following error:

````Library\PackageCache\com.unity.charactercontroller@1.0.0-exp.2\Unity.CharacterController\KinematicCharacterUtilities.cs(274,57): error CS0246: The type or namespace name ‘PropagateLocalToWorld’ could not be found (are you missing a using directive or an assembly reference?)```

I’m using unity 2022.2.12f1

The following package been installed ( it’s a fresh install but)

I also tried to reinstall the packages ( entities, physics ) manually ( without specifying any specific version ) but no luck

I also followed CharacterControllerSamples/_Documentation/Tutorial/tutorial-setup.md at master ¡ Unity-Technologies/CharacterControllerSamples ¡ GitHub.

Thanks

edit: it seems that com.unity.charactercontroller does not work with com.unity.entities 1.0.0-pre.65.
By using the same version than in the samples it seems to work,

Yes. It seems Unity broke packages by not waiting to update them all together. I’m not sure why. The latest Entities does in fact break their Character Controller package thanks to the sudden changes with Transforms (anyone know why this couldn’t be just marked depreciated until a new solution was available??? Seems like something that could have been considered).

At any rate, I guess we wait for the CharacterController package to get its update, or make the changes manually.

Hello @philsa-unity

is there an update planned for the com.unity.charactercontroller package?
it is actually not compatible with 1.0.0-pre.65 entities.

error :
Library\PackageCache\com.unity.charactercontroller@1.0.0-exp.2\Unity.CharacterController\KinematicCharacterUtilities.cs(274,57): error CS0246: The type or namespace name ‘PropagateLocalToWorld’ could not be found (are you missing a using directive or an assembly reference?)

yup, an update is being prepared and should be ready very soon. The update will also fix issues raised by @MildlyInfuriating in previous replies in the thread:

  • Characters now properly ignore collisions with other characters that have a non-collidable collider
  • Disabling the KinematicCharacterBody properly disables character interpolation

Heads up: this update will involve a breaking change, but it should be fairly quick to fix in your projects. Essentially, all characters must now have a “Collide” collision response instead of “Raise Trigger Events”. And the default method to call for your character’s “CanCollideWithHit” needs to be changed

I’ll be posting back here once the update goes live

5 Likes

Hello @philsa-unity , do you know when it will be available ( more or less ) .

Thank you.

The 1.0.0-exp.4 update is live. This one’s for Unity 2022.2.10f1 and above

Make sure to consult the “Upgrade Guide” section of the changelog in order to address breaking changes:
https://docs.unity3d.com/Packages/com.unity.charactercontroller@1.0/changelog/CHANGELOG.html

The Samples were updated to latest package

6 Likes

Thanks so much @philsa-unity . You are so helpful!

amazing!!!
i really like the package and everything is super clear btw!

could you please change the name of the CharacterInterpolation component to a more dynamic name such as “Interpolation” in the next release?
the interpolation functionality you implemented can be reused on many contexts such as projectile movement… and I prefer to use your implementation instead of having to reimplement mine to work in addition to yours or having to use the CharacterInterpolation component on contexts that have nothing to do with the character itself.
btw, you can also remove the interpolation feature from the package and add it to the samples.

Thanks again @philsa-unity

I think this might’ve worked prior to exp.4 (aside from the “character” name), but this latest release needs the interpolation job to check for an enabled character component.

I can see how this would be useful though. I’ll give it some thought

1 Like

After Installing havok package in a project with character controller inside, I get this error :

Library\PackageCache\com.unity.charactercontroller@1.0.0-exp.4\Unity.CharacterController\DisableCharacterDynamicPairsSystem.cs(66,57): error CS0246: The type or namespace name 'IBodyPairsJob' could not be found (are you missing a using directive or an assembly reference?)

Just noticed this issue as well; it happens when the Havok package is in the project. A quick temporary fix is to copy the character package locally and add Unity.Havok to the “Unity.CharacterController.asmdef” dependencies, but I’ll be releasing a patch for this ASAP

3 Likes

The 1.0.0-exp.5 update is live

This fixes the ‘IBodyPairsJob’ error when using Havok

2 Likes

I just upgraded to the latest release, set the collider to collide, and the collisions work as expected, but trigger events aren’t triggered anymore.

Is there any setting that needs to be enabled so that the Character collider will get detected by other physics objects with 'RaiseTriggerEvents` flags set?