I’ve built up a prototype of a sort of 3d linerunner. I want “riding” the line to be based on sliding physics. So far I’ve been using a first person charactercontroller, because it has sliding, walking, and controls all built in. When I hit the slide/line, I change the slope limit to 0, and everything works great UNTIL I reach a ramp or uphill section. As soon as the slope goes positive, Unity cancels out my velocity (immediately) and leaves me kind of glitching out at the bottom of the hill.
So I’m wondering if, before I go ahead and try to add a frictionless rigidbody to my character, there’s any work-around within the charactercontroller itself?
I added a public variable called frictionless that gets activated whenever the charactercontroller comes into contact with a frictionless surface. Then after the line
var velocityChangeVector : Vector3 = (desiredVelocity - velocity);
I added a line
if(frictionless) desiredVelocity += velocity;
so that it basically applies a force, rather than an impulse, if you’re on a frictionless surface. Also, I changed the if statement above:
// Find desired velocity
var desiredVelocity : Vector3;
if (grounded && TooSteep()) {
to
// Find desired velocity
var desiredVelocity : Vector3;
if (grounded && (TooSteep() || frictionless)) {