How to Line Trace from Camera Centre

I’m trying to trace a line from Camera Centre but line is being traced from Player’s eye location. I’m using the function “GetActorEyeViewPoint”. I’m doing this in my Rifle Class.
Here is the photo:

But I’m overriding this in Player Class later by Getting Camera Location to trace a line by overriding a pawn function called “GetPawnViewLocation” but still the line is being traced from Actors View point and not from Camera Centre.
Here is Photo of Player Class:


Note: While overriding the “PawnViewLocation” in Player class, I didn’t remove the “PlayerViewpointLocation” from Rifle Class. It is still there.

You are not overriding " GetActorEyesViewPoint" in that code. The second arrow points to a function named “GetPawnViewLocation” not “GetActorEyesViewPoint”.

You’re calling GetActorEyesViewPoint, I’m not sure why GetPawnViewLocation is being overriden?

1 Like

I’m still not sure about that.

Surely you intended to override GetActorEyesViewPoint?

Yeah

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

Privacy & Terms