Not distance culling. Frustum culling (the camera one).
I tried looking everywhere. And also asked in unreal slackers.
The best suggestion i got was to do something with CalcBounds();
Like override it or something.
Also user NikPik666 suggested the following:
But that seems to be for all actors. He didnt answer since then and i have no way to contact him.
I asked ChatGpt, and it gave me a bunch of suggestions.
All of them didnt work.
It said mostly to override the function that returns the bounds so that the engine always thinks the actor is in the camera view.
Since im a beginner in C++ in unreal engine.
I dont know if some interpretation of this could take us anywhere?
ChatGpt suggestions that i couldn’t implement:
// Override the GetLocalBounds function to always return a very large bounding box
virtual FBox GetLocalBounds() const override
{
return FBox(-FVector::OneVector * 10000.0f, FVector::OneVector * 10000.0f);
}
// Override the GetComponentsBoundingBox function to always return a very large bounding box
virtual FBox GetComponentsBoundingBox(bool bNonColliding = false) const override
{
return FBox(-FVector::OneVector * 10000.0f, FVector::OneVector * 10000.0f);
}
// Override the GetSimpleCollisionCylinder function to always return a very large bounding cylinder
virtual FCollisionShape GetSimpleCollisionCylinder() const override
{
return FCollisionShape::MakeCapsule(10000.0f, 10000.0f);
}
virtual FBoxSphereBounds GetActorBounds() const override
{
return FBoxSphereBounds(FVector::ZeroVector, FVector::OneVector * 10000.0f, 10000.0f);
}