Skip to content

Constraint based floor detection for a physbone collider.

License

Notifications You must be signed in to change notification settings

Zexxx/Smart-Floor-Collider

Repository files navigation

Smart Floor Collider

Static Badge Generic badge

Based on World Constraint.

It uses VRCFury for fast installation.

How to install it on your avatar

  1. Install the latest package
  2. Install VRCFury
  3. Drag and drop "Smart Floor Collider" onto the root of your avatar.

Note

You must remove or move the old floor collider to the "collider" game object under the World Constraint. (If you are reparenting your floor collider under the collider game object, remove the physbone collider component from "collider".

  1. VRFury should handle the rest. Click upload, and you are done.

How it works (locally) outdated for now

This works nearly identical to how world constraints normally work with a key few changes for this to work for this.

The first change is that the "World Constraint" only locks on the Y axis. Changing the Freeze Position Axis to only lock the Y axis allows the root parent constraint to follow us still around when it's holding an object in place.

As a result, when you turn off the child "Container" parent constraint, the object will stay in line with the avatar center but freeze in its last Y-axis position.

For the FX Controller, to detect whether the user is on the ground, we use the Global Parameter "Grounded," when the user is not grounded, the "Container" parent constraint is disabled which causes the floor collider to instantly stop moving as soon as VRChat detects the local client is not on the ground. As soon as the avatar returns to the ground with Grounded = True, the "Container" parent constraint is enabled again.

There is also a detection of whether the local client falls with VelocityY. An issue with freezing the floor collider in place is being able to fall through it. The falling state aims to detect when the user is not Grounded and if VelocityY is less than -2. This turns off the floor collider.

How it works (remotely)

//todo

About

Constraint based floor detection for a physbone collider.

Resources

License

Stars

Watchers

Forks

Packages

No packages published