Hi,
In the course of making a 2D platformer using rigidbodies/physics, I’m faking the movement to be more kinematic-like under certain conditions to get a more ‘cartoony’ movement. To do this I need a ‘grounded’ boolean which I can get a couple of different ways (e.g raycasting, checking velocity.y etc.). But this got me thinking… wouldn’t the physics engine need to keep a similar variable internally?.. and if so is there any way to access this, to improve on efficiency?

Thanks

The only grounded variable I know of exists for character controllers.
CharacterController.isGrounded is the boolean you would use.

If you want to go the raycasting route, this might help:

The concept you’re describing is, in the more general case of the physics engine, the set of contact points, be they ground, things sitting upon them, or fulcrums upon which they are teetering.

It seems not so easy to maintain that set of contact points.

But certainly they are in there: a count of them, including sleepers, is even visible in the Profiler.