Fov

Hi,
Educational Game for K-2nd Grades.
Take photos of animals to identify.

I am trying to create an in-game camera that can zoom into a targeted animal that only lists the animals in the in-game camera’s FOV. Using 90 degrees.

This all works except…

When a picture of an animal, say zebra is taken, there is only 1 zebra with a unique ID in the camera lens but it is listing all the zebras in the level and not just in the in-game camera’s FOV.

Having trouble need help. I think the problem is not using the FOV node correctly.
Thanks.

Hi, could you post screenshots of the code you wrote to create this system?

The FOV itself is just a number for your camera manager and not related to any method of getting any visible actors unles you implement such a system.

It’s hard to say without knowing how you’re getting animal references.
In any case, there’s a useful node called [Was Actor Recently Rendered] that can tell you if the actor is actually seen on the screen. It might help.

Thanks to everyone for replying. Sorry for the delayed response. A little background.
I allow students to use Unreal for 3D software designs. I am getting better at this myself, but this problem stumped me.

This is intended to be an education video. K-2nd grade. Students complete missions like taking photos of 4 zebras. Each photo is taken by a hand held camera in the game and they can zoom into the zebra.

When the picture is taken, it is suppose to record how many zebras are in the FOV of the camera. But instead it is recording every zebra in then area, even behind the player. Behind the player there is no FOV, or shouldn’t be.

The blueprint is a mess and I had to break it up in three images.

The first image shows the target being create.

The second image shows the continuation, which creates the file.

The third part shows where the recording is looking for all zebras in the camera’s view. Then output to a string.

What works is the following:

  1. Picking up the camera.
  2. Activating/Deactivating the camera.
  3. Zoom In/Out.
  4. Take Photo.
  5. Store image to drive.

What does not work is the number of zebras in the photo may be one, but the output string is showing most of the zebras in an area equal to the third person starter platform. This should only record the zebra/zebras in the camera lens and not the area.

My guess is that the FOV of the camera would be needed to cover only that 90 degree angle.

Thanks for any help you can provide.
Tony

I have a feeling that “ConvertWorldLocationToScreenLocation” is returning actors behind the camera because you are converting 3D to 2D and losing the information if an animal is in front or behind the view. You could add an additional check like " WasRecentlyRendered" to each animal actor, or test if “FindLookAtRotation” is not pointing towards the opposite direction of the camera’s rotation.

1 Like

Thank you. I will have the student try this and return a better reply.

:smiley:

I want to thank you.
This was a mostly fix, but good enough.
He used the " WasRecentlyRendered" node. This removed all animals outside of the in-game camera FOV. Called BP_Camera.

I wanted to make sure I posted the fix for this in case others need it.

Thanks again.

1 Like