I need to know if the player is able to see a certain actor/component or not in my game, but I can’t figure out how to do this in Blueprint, and if it is even possible at all?
I can do traces from the player camera, but that traces from the actor, not from what the camera actually sees. I can do forward vector trace but I don’t have much luck with that either. I want to know if the camera currently displays this actor. That would open up a wide number of gameplay possibilities.
So I basically want to retrieve “IsCurrentlyFrustrumCulledByCamera” true false, or something along those lines.
In the c++ there is a function for controllers / the real camera
/**
00132: * Checks line to center and top of other actor
00133: * @param Other is the actor whose visibility is being checked.
00134: * @param ViewPoint is eye position visibility is being checked from. If vect(0,0,0) passed in, uses current viewtarget's eye position.
00135: * @param bAlternateChecks used only in AIController implementation
00136: * @return true if controller's pawn can see Other actor.
00137: */
UFUNCTION()
00139: virtual bool LineOfSightTo(const class AActor* Other, FVector ViewPoint = FVector(ForceInit), bool bAlternateChecks = false);
Do you have a code-based project where you could compile BP library functions?
I could make this function into a callable BP library function if you can compile it
This is a question from the beta version of the engine. We are marking this answered for tracking purposes. If you are experiencing an issue similar to this please post a new question.