Well I looked for the Lua code that the fin tool uses but couldn't find it so I am here to see if anyone knows how it applies its force. I am currently working on a project which has wings that retract and need to be able to disable and enable the fin effects on the vehicle with E2. I have tried a large amount of ways to achieve this such as using the wire latch, or switching from welds to parents so that the wing only gives physics to the base when I want it to. But I have been unable to find something that reliably works well. What I would really like is the ability to either make a specific prop act like the fin tool is being used on it, (with specific settings) or even better to have the formulas used so that I could make the base act as if it is having a wing with the fin tool on it. (for example, using applyOffsetForce() on a base prop where it acts as if a wing hologram attached to it is being affected by the fin tool. Alternately if anyone has any ideas on how to make a wing that has become a fin manually to attach and detach nicely I would appreciate that too.
[code]
VelL = Ent:velL()
Lift = atan(VelL:z() / VelL:setZ(0):length()) * VelL:length()
Ent:applyForce( Ent:up() * -Ent:mass() * (Lift / 100) )
[/code]
I am not sure if this is what fin does, but it emulates it fairly well. You can change the [i] Lift / 100 [/i] to suit your needs.
To use this with offsetForce is a bit trickier as you can't use the entity's velocity or mass. You have to use the velocity of the vector
you will be applying the force at local to the direction the "fake wing" would be facing, and some other multiplier for the mass.
[editline].[/editline]
An interesting thing about this is you can add or subtract an offset from the [i]atan()[/i] part and it will act as an elevator without actually angling the prop.
awesome thanks
Sorry, you need to Log In to post a reply to this thread.