Ok i've been wondering how I should use the applyTorque() function and I took it upon myself to come up with some sorta way to do it.
This is what I have and it even works on the prison pod that applyAngForce cannot use very well.
Code:
@name ApplyTorque Angkeep
@outputs Ea:angle Save:vector M Weight
runOnTick(1)
E = entity():isWeldedTo()
#Ea = angnorm(E:angles()-(owner():pos()-E:pos()):toAngle())
Ea = angnorm(E:angles())
if(E:boxSize():length()/2 > 10){
M = E:boxSize():length()/3
}else{ M = M = E:boxSize():length()/4 }
if(first()){
Save = E:pos():setZ(owner():shootPos():z())
Weight = E:mass()
}
if(!E:isPlayerHolding()){
E:applyTorque( shiftR( vec( angnorm(-Ea-E:angVel()) ) ) * (M^1.4) )
E:applyForce((Save-E:pos())*(E:mass()^1.4)-E:vel()*(E:mass()/2))
if(Weight <= 200){
E:setMass(200)
}
}else{E:setMass(Weight)} This is just a base for you to learn from, since I figure it's for advanced users i'll just let you sort it out and remake it any way you feel the need.
Bookmarks