Powering Cylindrical-constraints

Hi there!

I’m working on a standard chassis.

How would I go about powering cylindrical-constraints from a vehicle-seat? (for the wheels)

Any help is much appreciated! :grinning: :+1:

Hi there!

If I read this im thinking u need this!
Watch this tutorial!

I hope this works.

Friendly greetings,

Tim.

That tutorial doesnt explain cylindrical constraints at all…

Also hinges from the surfaces property has been deprecated, so that tutorial is old/doesnt work

Oh, okay, then I can’t help you, sorry!

Then what was the point of replying? next time, please read the question more clearly before you jump to show me a random chassis tutorial that doesnt help in the slightest…

1 Like

here

this tutorial has a car made of cylindrical constraint and powered by it

probably watch ep2

You rotate the cylindrical constraint based on seat.Throttle property. It ranges from 1 to -1 depending on the player’s input.

Thanks, I’ll check it out! :grinning: :+1:

Could you explain more? Maybe provide some code?

if seat.Throttle==1 then
   cyliderconstraint.AngularVelocity=10
elseif seat.Throttle==-1 then
   cyliderconstraint.AngularVelocity=-10
elseif seat.Throttle==0 then
   cyliderconstraint.AngularVelocity=0
end

So basically, if you set the AngularActuatorType property to Motor then it allows you set AngularVelocity. But first, set the MotorMaxTorque to something high so it has enough turn power. You set the angularvelocity to a number then multiply it with seat.Throttle. When the player isn’t pressing any keys throttle is 0. So when input is none then the angularvelocity is equal to 0 therefore resulting in no movement.

You need to wrap that in some sort of loop or use runservice also more efficient to just multiply it by seat.Throttle.

yes i know i just gave that as an example on how you would do it

I have a question, how would i make it rotate 360 degrees left and right when .SteerFloat is -1 or 1 and go back to center if its 0?

now i actually made a working steering wheel like that (actuator type servo) but what i did is putting the speed at like 6 and when .SteerFloat is -1 or 1 the angle gets set so it moves that way, but my problem is, if its going more than 90⁰ then its making a full turn when i then try to counter steer for some reason.

how would i make it turn 360 degrees based on -1 and 1 without it breaking?

maybe i used the cylindrical constraint wrong im not sure…

I assume you mean 180 degrees, but you should be able to multiply it by 180 or 360