Quantcast
Channel: Programming (In-game)
Viewing all articles
Browse latest Browse all 645

Rotor's attached grid

$
0
0
Is there a way to find out which grid is attached to a rotor?

Something like connectors:
Code:
List<IMyShipConnector> connectors = new List<IMyShipConnector>();
GridTerminalSystem.GetBlocksOfType<IMyShipConnector>(connectors, x => x.CubeGrid == Me.CubeGrid);

...

IMyCubeGrid seachedGrid = connectors[0].OtherConnector.CubeGrid;
Thank you for the help. :)

Viewing all articles
Browse latest Browse all 645