GetPlayerViewPoint Question

In the Gun::PullTrigger function, we use OwnerController->GetPlayerViewPoint to get the viewpoint.
Is it correct that for our pawn (the player), the viewpoint is from the camera we attached in the BP_ShooterCharacter?

I am a bit confused about the enemy. The enemy is an instance of the BP_ShooterCharacter with the ShooterAIController. So where is the viewpoint of the enemy? Is it the camera attached to the character or is it the eye location of the enemy? If it is the eye, is it because the controller is an AI controller so it just ignore the camera that is attached to the character?

The docs basically answers this question

Returns Player’s Point of View For the AI this means the Pawn’s ‘Eyes’ ViewPoint For a Human player, this means the Camera’s ViewPoint

https://docs.unrealengine.com/en-US/API/Runtime/Engine/GameFramework/APlayerController/GetPlayerViewPoint/index.html

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms