How I can get the fort_vehicle from the vehicle_spawner device?

Hi!

I am trying to get the fort_vehicle from a vehicle_spawner so after that I can check the location of the vehicle.

    CarSpawner : vehicle_spawner_pickup_truck_device = vehicle_spawner_pickup_truck_device{}

    GetFortVehicle() : void =
        if(Car:=fort_vehicle[CarSpawner]):
            TransformV:=Car.GetTransform()
                X:=TransformV.Translation.X
                Y:=TransformV.Translation.Y
                Z:=TransformV.Translation.Z

It seems that the if will fails always, as I can not cast the Spawner to for_vehicle. How I can get it?

I wonder if it might be a value returned in the tuple from:
VehicleSpawnedEvent<public>:listenable(tuple()) = external {}
which you can Subscribe to in the usual way.

Unfortunately I don’t know how to find out what the contents of that tuple() actually are, given that it isn’t detailed in Fortnite.digest.verse. That information might be here in the API documentation if you’re lucky.

I think you can only get a vehicle reference that a player is currently in. So you’d have to first get the fortcharacter and then maybe cast that instead of casting the carspawner

@EV_WAKA is correct. You’d have to get a fort_character first, then call GetVehicle[] to get their associated fort_vehicle, if one exists. So assuming you had a fort_character assigned to a variable MyCharacter, you could do the following:

if (MyVehicle : fort_vehicle = MyCharacter.GetVehicle[]):
    # code that does something with MyVehicle

Thanks