private void MountVehicle(DrivingComponent drivingComp) { Debug.Log("Mounting: " + drivingComp.gameObject.name); // Parent player to mount location gameObject.transform.SetParent(drivingComp.mountLocation, false); gameObject.transform.SetPositionAndRotation(drivingComp.mountLocation.position, drivingComp.mountLocation.rotation); playerComp.playerFlags |= PlayerComp.c_MOUNTED; }
// Called from InteractableComponent public void DriveVehicle(DrivingComponent drivingComp) { MountVehicle(drivingComp); // Probably set up the driveable vehicle so it can move }