I’m trying to prepare a camera system for my motorcycle game. It requires a secondary camera component to move location/rotation in order to keep both the player and the target in frame (up a limit, forwards visibility is still required). When hitting the focus key, it should check to see if any suitable targets are within range. If there are, then it should make the nearest focus target and then orientate the camera on it. Subsequent presses of the focus input should focus on each of the next nearest targets and move the camera into a suitable position. Once all targets have been viewed, the final focus press should reactivate the starting camera.
So far I have tried to prepare a function which adds all actors which implement a certain interface into an array (if they are within the minimum target distance). You can see the basic process here:
I feel like there’s probably some problems in here but I’m more focused on the second section at the moment.
In my camera component blueprint, I am trying to update the rotation based on the location of the focus target. I’m using the node “Find look at Rotation”. You can see my method here:
When I activate my focus camera the initial movement seems correct, it centres on the target quickly. But then it doesn’t seem to stop rotating. I need to restrict the movement so that the camera does not move beyond certain values (to allow the player to see obstacles infront on him/her).
Does anyone see anything I doing wrong obviously? Or have any suggestions to how I might improve the focus target array building. This feels like a more complex feature than I’ve made before and I’d apprecaite the advice.