Here’s what I have so far:
Multiple “waypoint” actor blueprints, each with an individual int value are spread across the level- 10 waypoints, each numbered 0-9.
Right now, at event begin play, the AI character spawns at a random waypoint- this works fine.
However I want to take it a step further and have it so that the random waypoint chosen must be out of view of the player camera, to prevent spawning in front of the camera which spoils immersion.
I’ve been playing around with the camera camera forward vector node, but I’m having trouble achieving this logic:
IF “randomwaypointactor” IS in the player’s camera view, then select another waypoint.
Gathering up the points and seeing if they are in the view is what I’m stuck on. Any help would be much appreciated!
I’d prefer not to use EQS for this case, and have it all run through the player or level blueprint.
EDIT: I made a somewhat hacky solution by having a large box collision under the player blueprint that is very wide and long, and faces out from the camera, which then checks to see if any waypoints are overlapping when trying to spawn. However this causes 2 problems:
- It limits the spawn to be only behind the player- ideally I’d like it to be possible to happen in front of the player too, just not in view- behind a wall, in a room etc.
- It seems that having a huge box collision facing out from the player blueprint isn’t the most efficient or effective way of doing it.
I’ve also tried multi trace by box which doesn’t seem to work as expected, and I can’t use line traces as they only return what is in the centre of the screen and not anything visible on the screen. Any help with this would be much appreciated.