[UE5-0 City Sample] How to drive AI traffic cars

In City Sample we can drive only parked cars so I’m trying to interact/drive that AI’s traffic with editing “BP_CarEntryInteraction”, but I cant get it what value defines car is running/parked. running cars are generated completely different logic from parked?

Alright I found it defined with “CitySampleVehicleBase.cpp” source files

void ACitySampleVehicleBase::OnTrafficVehicleSpawned_Implementation()
{
	bIsPossessableByPlayer = false;
}

Changed “false” to “true”, and shipping build causes I could get in NPC’s cars. But can’t move completely and no way expect get out. Is anyone else looking into this?

Hi found a solution.

Edit: CitySampleMassVehicleBase.cpp

change from false to true:

void ACitySampleMassVehicleBase::PrepareForPooling_Implementation()
{
	SetActorEnableCollision(true);
}

edit CitySampleVehiceBase.cpp

change void ACitySampleVehicleBase::SetVehicleInputs_Implementation(const float Throttle, const float Brake, const bool bHandBrake, const float Steering, const bool bSetSteering)

to:

void ACitySampleVehicleBase::SetVehicleInputs_Implementation(const float Throttle, const float Brake, const bool bHandBrake, const float Steering, const bool bSetSteering)
{
	
	if (bIsPossessedByPlayer)
	{}
	else
	{
		SetThrottleInput(Throttle);
		SetBrakeInput(Brake);
		SetHandbrakeInput(bHandBrake);

		if (bSetSteering)
		{
			SetSteeringInput(Steering);
		}
	}
}

Thank you~! The only thing I’d offer to newer people is that I needed to generate the visual studio files and rebuild the solution after following the instructions in this thread.(working in 5.1)

HI but i am not able to find these code in visual studio. I am using 5.4 version sample city project

you have to edit the cpp files and not the header files