This object is in archive! 

Wheels cannot be placed if you have fenders around it

Gwindalmir shared this bug 6 years ago
Solved

A custom built wheel system, with fenders, somehow blocks wheel placement, even though it should not.


I have solved the issue in code.

In MyMotorSuspension.CanPlaceRotor, the wheelPosition used is not based on the user set height, nor the dummy of where the wheel should be located.

The first two lines of that method:

float wheelDistance = BlockDefinition.Size.Y * CubeGrid.GridSize - 0.2f * CubeGrid.GridSize;

Vector3D wheelPosition = this.WorldMatrix.Translation + this.WorldMatrix.Up * wheelDistance;


Should be replaced with:

var suspensionAx = PositionComp.LocalMatrix.Forward;

var wheelPosition = Vector3D.Transform(DummyPosition + (suspensionAx * m_height), CubeGrid.WorldMatrix);


Which will solve the problem.

Replies (2)

photo
1

Howdy keen devs, the above picture is one of my blueprints, if you want a copy of that to test this fix please dont hesitate to let me know, i'd be happy to send a few (preferentially not through workshop, as these arent intended to be public BP yet)


Cheers

photo
2

This issue has been resolved in Minor update v187.2

Replies have been locked on this page!