Controlling Spawned Vehicles

Hi, I am testing the City Sample Vehicles and I am able to control them using blueprints when I add them to my map but I am missing something when I try to spawn them and then control them as they don’t move. Here is a very simple blueprint of what I am testing:

The actor BP_Vehicle13_car moves but the spawned BP_Vehicle02_Car doesn’t.

What am I missing?
Thanks

Hi Jeros,

Make sure you are ‘possessing’ the vehicle you want to control.

Also, you may need to set up a ‘Throttle’ input in your project. (Project Settings → Input)

Your current graph is spawning the vehicle and setting both to full-throttle (but if there is a ‘set throttle input’ node in either of those vehicles it will be instantly overwritten.)

Let us know if you have any more questons!

Thanks for the response. I posted a simplified version of what I am trying to do which works with vehicles in the map but not with spawned vehicles. What I want to do is control the vehicles through code and not using a controller so I am not sure how to possess them in this case. I have an interface ‘SetVehicleInputs’ that sets all inputs and my vehicle blueprint implements the interface… the following is the entire event graph for my BP_Vehicle thus I removed all other controller inputs:

My vehicle class also includes a BP_VehicleComponent that creates a timer and calls the interface. In this sample it is always calling it with a value of 1 for the throttle.

Now, in my map i simply spawn one vehicle.

When I run it, the Vehicle_02 is spawn and I can see that every second the SetVehicleInputs is called for both the spawned vehicle and the vehicle in the map, but only the vehicle in the map advances.

Thanks again!

I think I figured it out. Spawning a default controller for the spawned vehicle seems to do the trick.

1 Like

Thanks a lot ! This post maybe save our game :slight_smile:

1 Like