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)
you have to edit the cpp files and not the header files
Has anyone found where and how to stop the mass traffic / pooling interface to not destroy / avoid culling and remove the entity / car from the pooling from the traffic system after possessing it ? i tried different blueprint methods and overrides and some things in cpp but i cannot seem to be able to stop the car from being part of the fragments / system that ends up despawning it suddenly after it’s too far from it’s intended spawn / traffic system.
