Is there a better way to Access another Actor Component in same actor without FindComponentByClass<>()

You could store it as a pointer on the same actor:

UPROPERTY()
  UTraceComponent* TraceComponent = nullptr;

But usually there are better ways to write your code so you don’t have to do that:

  1. Move the logic to update the camera into the component.
  2. Don’t use tick, only use delegates (Observer pattern) to do things just when they are required. Sometimes you have to use tick but usually not.
2 Likes