Expression 2 steering help

Hi

I am trying to make a steering expression based on applyAngForce or applyOffsetForce.

but I need to figure out how to make the rotation of the E2 relative to the chassis of my car.


@name steering
@inputs Left Right
@outputs Gyro:angle
@persist 

runOnTick(1)

E = entity()

Gyro = ang(0,0,0) - Plate:angles()*500

Plate:applyAngForce(Gyro + $Gyro*5)

if(Left==1)
    {Gyro = (ang(0,45,0) - Plate:angles())*500
    Plate:applyAngForce(Gyro + $Gyro*5)}
        
if(Right==1)
    {Gyro = (ang(0,-45,0) - Plate:angles())*500
    Plate:applyAngForce(Gyro + $Gyro*5)}


that is what I have.

Do it with something like an entity marker attached to the chassis and an entity marker attached to the wheel hub or steering mechanism.

Plate = entity():isWeldedTo()

At the beginning, that should work (add it after the runon tick)

hmmm, I tried using isWeldedTo just now but it didn’t seem to work. the expression is going to be axis’d onto the chassis of my car and then adv ballsocketed to my wheels. I can make them turn but I want them to have a default position which is straight, and I can’t quite make it happen.

I also tried tried using E:isConstrainedTo(N), but to no avail.

E:getConstraints(N)

that didn’t work either, I went to mouse control now instead and it works sort of but I need a different command than:


@inputs In
@outputs Gyro:angle
@persist 

runOnTick(1)

Me = owner()

Plate = entity()

P = 0
Y = Plate:bearing(Me:aimPos())
R = 0

if(In==1)
{Gyro = -ang(P,Y,R)*1000
Plate:applyAngForce(Gyro + $Gyro*5)}


that only works for me, so no one else can drive, if at any point my cross hair actually hits the frame of my car then it doesn’t steer right.

Should I use E:eye(), and if so how.

the reason it only works for you is because you used Me = owner() you need to say that Me = (the person driving) i assume they are in a chair, and then you can use Me = driver():(VEHICLE ENTITY)

other way around, Me = Pod:driver()
Variable Pod is an input, and an entity.
Link it to the adv pod controller.

thanks guys I have one more question, is there a way to limit how far it can rotate.

adv ballsocket/ropes