Create a proper fake sector for elevators

Also adjusted the loglift box shape to encompass the entire lift.
This commit is contained in:
Moonstone Studios 2023-10-28 19:29:35 -07:00
parent 3ce50935c6
commit 2af563ceaa
No known key found for this signature in database
GPG Key ID: 049449FDBA649F3E
2 changed files with 4 additions and 12 deletions

View File

@ -19,15 +19,16 @@ public class QSBElevator : WorldObject<Elevator>
public override async UniTask Init(CancellationToken ct)
{
var boxShape = AttachedObject.gameObject.GetAddComponent<BoxShape>();
boxShape.center = new Vector3(0, 1.75f, 0.25f);
if (Name == "LogLift")
{
boxShape.size = new Vector3(5, 3.5f, 8);
boxShape.size = new Vector3(4.6f, 3.5f, 12);
boxShape.center = new Vector3(0.1f, 1.75f, 1.3f);
}
else
{
boxShape.size = new Vector3(3, 3.5f, 3);
boxShape.center = new Vector3(0, 1.75f, 0.25f);
}
_elevatorTrigger = AttachedObject.gameObject.GetAddComponent<OWTriggerVolume>();

View File

@ -101,18 +101,9 @@ public class QSBSectorManager : WorldObjectManager
// TH elevators
foreach (var elevator in QSBWorldSync.GetUnityObjects<Elevator>())
{
// just create a sphere at the attach point lol
// since players will be moved there when riding the elevator
// --
// The attach point on the game object itself to
// sync player attachment properly.
FakeSector.Create(elevator.gameObject,
elevator.GetComponentInParent<Sector>(),
x =>
{
x.gameObject.AddComponent<OWTriggerVolume>();
x.gameObject.AddComponent<SphereShape>();
});
x => x._triggerRoot = elevator.gameObject);
}
// rafts