# Customizing ECameraGroupActorComponent

*ECameraGroupActorComponent* is a component responsible for determining a group actor's location and rotation. You can override this component to customize your own way of location/rotation resolution.

1. Right click on Content Browser -> select "Blueprint Class" -> Search for "ECameraGroupActorComponent" -> click "Select".
2. Rename it as whatever you want. Here I name it *MyGroupActorComponent*. Open the blueprint class and you can see the "Functions" section on the left side of the blueprint window. There are several implementable functions in this section. For this component, you should implement the **GetGroupActorLocation** and **GetGroupActorRotation** functions, while other functions, if meet your needs, can also be implemented. <br>

   <figure><img src="https://1253177398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIc7aRtmwmEkkqEJZORmC%2Fuploads%2Ft6yLGg2gXETstZDsSQRB%2Fgroupactorcomponent-functions.png?alt=media&#x26;token=a862f47c-864e-4d52-a1b6-04710966a173" alt=""><figcaption></figcaption></figure>
3. Below is a simple example using the location of the first target in variable `TargetActors` as the group actor location. Note I am not calling the parent **GetGroupActorLocation** method because I would like to implement it from scratch. It is totally feasible to call the parent method if you need it. <br>

   <figure><img src="https://1253177398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIc7aRtmwmEkkqEJZORmC%2Fuploads%2FLdaxXVwpmerTBWROJADB%2Fgroupactorcomponent-getlocation.png?alt=media&#x26;token=9bde42fc-c983-4b15-84cc-c4106cb23a8b" alt=""><figcaption></figcaption></figure>
4. Create a new *ECameraGroupActor* class. Right click on Content Browser -> select "Blueprint Class" -> Search for "ECameraGroupActor" -> click "Select". I name it *MyGroupActor*. Click the "CameraGroupActorComponent" on the left, and on the "Details" panel, change the "Component Class" property value to *MyGroupActorComponent*. &#x20;

   <figure><img src="https://1253177398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIc7aRtmwmEkkqEJZORmC%2Fuploads%2F3Bil9tJDrRxrmQpqz5q2%2Fgroupactor.png?alt=media&#x26;token=0ca6c59e-ea32-4f86-be4a-fba8dd828759" alt=""><figcaption></figcaption></figure>
5. Drag the *MyGroupActor* blueprint into the level to instantiate a new group actor. Add two actors to the "Target Actors" property.  <br>

   <figure><img src="https://1253177398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIc7aRtmwmEkkqEJZORmC%2Fuploads%2F1KpVPfOhIDJZZ3Q8DnEX%2Fgroupactor-target.png?alt=media&#x26;token=dd66391e-fe23-4bcc-9f0e-2f8026054a0c" alt=""><figcaption></figcaption></figure>
6. Back to the camera actor (of class `ECameraBase` or sub-class of `ECameraBase`), specify *TargetingAim* to the "Aim Component" property and specify *ScreenFollow* to the "Follow Component". Go to the blueprint where you want to call this camera. Invoke the *CallCamera* node and specify "Camera Class", "Follow Target" and "Aim Target". The passed in aim target should be the reference to the group actor you just created in level. You can also specify blending parameters if you like. <br>

   <figure><img src="https://1253177398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIc7aRtmwmEkkqEJZORmC%2Fuploads%2FNJKdSQJgstHbKe6mqdwn%2Fgroupactor-call.png?alt=media&#x26;token=e6b1d268-cb9c-4e2c-b193-cc022d399c88" alt=""><figcaption></figcaption></figure>
7. Run the game. You will see that camera is always aiming at the first target actor in "Target Actors". <br>

   <figure><img src="https://1253177398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIc7aRtmwmEkkqEJZORmC%2Fuploads%2FR7IoZ25Iro1StTizJKES%2Fgroupactor-show.png?alt=media&#x26;token=d83e7ebf-e6ae-445a-b85c-331c0d683844" alt=""><figcaption></figcaption></figure>
