Not a member yet? Why not Sign up today
Create an account  

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Propulsion Script works on one vehicle but not another

#1
Hi, I have the following LUA script in two vehicles.

prevPitch = 0
function Update(I)
 currPitch = I:GetConstructPitch()
 I:Log(currPitch)

 pitchAcc = currPitch - prevPitch
 I:Log(pitchAcc)

 if pitchAcc<0 then
  I:RequestThrustControl(4,-pitchAcc) 
  I:Log('Thrusters On')
 else 
  I:RequestThrustControl(4,0)
  I:Log('Thrusters Off')
 end
 
 prevPitch = currPitch
end

The point of this script is to make the upwards facing thrusters come on before the vehicle's pitch becomes positive. It works the way it's supposed to in the first vehicle, but on the second one, none of the propellers ever turn on, even though all upwards propellers on both vehicles are set to "thruster (reverse)".

Rocket Speed is the first vehicle; the Filthy Switt is the second.


Attached Files
.blueprint   Rocket Speed.blueprint (Size: 49.07 KB / Downloads: 16)
.blueprint   Filthy Switt.blueprint (Size: 447.19 KB / Downloads: 16)
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)