squidingtin

Mono-wheel script SE

Apr 19th, 2021
498
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string seatName = "seat name";
  2. string rotorName = "rotor name";
  3. float speed = 1;
  4.  
  5. IMyShipController c;
  6. IMyMotorStator r;
  7.  
  8. Vector3 mi;
  9.  
  10. public Program()
  11. {
  12. c = GridTerminalSystem.GetBlockWithName(seatName) as IMyShipController;
  13. r = GridTerminalSystem.GetBlockWithName(rotorName) as IMyMotorStator;
  14.  
  15. Runtime.UpdateFrequency = UpdateFrequency.Update10;
  16. }
  17.  
  18. public void Main(string argument)
  19. {
  20.   if(c.IsUnderControl)
  21.     mi = c.MoveIndicator;
  22.   else
  23.     mi = Vector3.Zero;
  24.  
  25.   if(mi.Z == -1)
  26.     r.TargetVelocityRPM = speed;
  27.   if(mi.Z == 1)
  28.     r.TargetVelocityRPM = -speed;
  29.   if(mi.Z == 0)
  30.     r.TargetVelocityRPM = 0;
  31. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×