Help with BodyGyros sliding

Lets just cut to the chase, I was making a bike in a game that players can ride and I’m using Body Gyros to orientate the vehicle left and right (For leaning). and to make the player lean its a part that rotates on the X axis, When I hold still and the body gyro is angled even the very slightest it starts to slide in the direction that is leaning. Any ideas?

2 Likes

I may not be super experienced with BodyGyros, but you could try to Tween the D to 0 when there’s no input pressed.

But I can’t be too sure, would you like to drop the code you’re using to control the gyro?

2 Likes

I’ve tried changing the Damping to 0, It does nothing and to change the angle of the BodyGyros I found this works pretty well,
image

1 Like

I should mention it doesn’t slide if I don’t give it a angle to lean upon

1 Like

i had the exact problem on my raycast car,all i did was did a check if the the drive keys werent pressed and the speed of the car wasnt 0 then i would make the chassis part of it to have 0,0,0 on AssemblyLinearVelocity

this was my code

		if carPrim.AssemblyLinearVelocity.Magnitude < 3 and seat.ThrottleFloat == 0 then
			carPrim.AssemblyLinearVelocity = Vector3.new(0,0,0)
		end

carPrim is the chassis part where all the car body and other stuff is on

3 Likes

I want to stay away from setting the velocity manually but I’ll keep this in mind, thanks

1 Like

just a thing,if you notice closely after your bike stops,the wheels still rotate,could be that?

I would probably assume thats the sliding thats moving the wheels, because when no buttons are pressed the wheels don’t actually have brakes I’ll change that and see if it changes anything

1 Like

just tried it, I don’t see any changes with the issue

1 Like

Maybe for the Idling bool in your script it should detect if there’s player input instead of the idle playing, just a suggestion.

Also, I think you can just anchor the bike or it’s wheels inside the if CurrentSpeed <= SpeedToIdle code.

anchor is bad,imagine the bike was falling from a height…

I kind of wanted to prevent the bike from being anchored or its speed Adjusted in that manner, But again, I’ll try that as a last resort

1 Like

what do you use for your bike? hinges?
another reason could be player mass?

1 Like

I didn’t even think of it in that matter.

@mrkomps, can I see the code of how you’re rotating the bike?

the only way my bike is moving is CylindricalConstraints, I’ll go test the Player mass

1 Like

my car is also by cylindrical,so you could just make the same way i did before,another way would be stopping the tire rotation by setting MaxTorque to 0 i think

1 Like

Rotation for the bike Idle is like this,
image

and steering is like this:

1 Like

I’ve tried that already, seems like theres no limit to how much force it slides or something.

try setting the cylindrical from Motor to Servo when idling and see what happens

1 Like

I don’t think its the wheels rotating thats the issue, its actually the bike sliding

1 Like