ok so my latest Project is an automatic Hover Tank (because wheels are so last century), but a few issues have arrised with the codeing and i have no idea whats wrong 
first problem i need to sort out is the hovering, atm it just shoots accross the map and into the corner.
code wise atm i have
Code:
@name Hover Hieght Control
@inputs E:entity RC
@outputs
@persist Mass I Array:array
Array = E:getConstraints()
Count = Array:count()
while(I < Count) {
Mass = Mass + Array[I,entity]:mass()
I++
}
if(RC > 35) {E:applyForce((E:pos() - E:up())*Mass - E:vel()*1)} else {if(RC < 35) {E:applyForce((E:pos() + E:up())*Mass - E:vel()*1)} else {}}
runOnTick(1)
E1=entity(),EE=(E1:isWeldedTo() ? E1:isWeldedTo() : E1)
EA=-EE:angles()*15-EE:angVel()*2
EV=EE:massCenter(),ER=EE:right(),EF=EE:forward(),EU=EE:up()
Lev=EE:inertia():length()
EE:applyOffsetForce( EU*EA:pitch(),EV-EF*Lev)
EE:applyOffsetForce(-EU*EA:pitch(),EV+EF*Lev)
EE:applyOffsetForce( EU*EA:roll() ,EV-ER*Lev)
EE:applyOffsetForce(-EU*EA:roll() ,EV+ER*Lev)
i have no idea why this isnt working and any sudjestions will be great, even better if they work
Bookmarks