how can I destroy a player also the vehicle when he leave it

how can i destroy/eliminate player / or vehicle when he leave it, I couldnt find any device for destroying objects/players. does it need to be done in verse?

you can make it so a player can’t leave the car, by pointing the assign driver to a spawnpad

How intuitive, is that behaviour documented anywhere? Might be a bug.

If you want the driver to be unable to leave the vehicle, place a vehicle and set it up as following:

  • Under Events, Click Add to the right of ‘Player Exits The Vehicle Send Event To’
  • Click Select Device and select the vehicle device
  • Click Select Function and select ‘Assigns Driver’
  • Click the ‘OK’ button to save

Start the game to test. Once you get inside the car, you won’t be able to get out until you leave the game, the car blows up, or something triggers your escape.

So, how do you trigger your escape? Here’s one way I thought of and tested. Place a trigger and set it up as follows:

  • Under Events, click add to the right of ‘On Triggered Send Event To’
  • Click Select Device and select the vehicle device
  • Click Select Function and select '‘Disable’, ‘Respawn Vehicle’, or ‘Destroy Vehicle’
  • Click the ‘OK’ button to save
  • Click the ‘OK’ button to save

Start the game to test. When you run over the trigger the car will let you off and either it will return to the spawn pad or disappear

There are many other methods to make this work, but this is the simplest without writing any code. Destroy Vehicle and Respawn vehicle would destroy the car for you.

1 Like

Thank you Major-Koas that helps me.

You’re very welcome :smiley:

1 Like

also I tried to write a verse device working as a checker but I don´t why is not taking Variable IsRidingMotorcycle as it should… anyone knows why? I dont know how expensive would be to check all the time for driver on a vehicle

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

See Create Your Own Device Using Verse for how to create a verse device.

A Verse-authored creative device that can be placed in a level

MotorbikeRespawn := class(creative_device):

# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
    print("The MotorbikeRespawn device has started!")

    # Create a variable to store the motorbike actor
    Motorbike := get_actor_by_name("Motorbike")

    # Create a timer that fires every second
    create_timer(1.0, TimerEvent)
    
    
    # Called every second
    TimerEvent<override>()<suspends>:void=
        
        bool isRidingMotorbike := is_player_riding_actor(Motorbike)   ---->here is error

        if (isRidingMotorbike):
            # Destroy the motorbike
            destroy_actor(Motorbike)
    
            # Respawn the motorbike on the platform
            respawn_actor_at_location(Motorbike, get_actor_location("Platform"))
    
            # Respawn the player at the platform
            respawn_player_at_location("Player", get_actor_location("Platform"))