Announcement

Collapse
No announcement yet.

Check if player has line of sight? [solved]

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    no problem

    Just as a quick node:^^
    The PlayerController's location is the last spawn-location, the rotation is however the current rotation (at least in the 1st person view).
    To get the location of the player you have to use Pawn's location.
    Pawn's rotation is only left and right in the normal walking mode, so no up and down.

    Leave a comment:


  • replied
    Originally posted by Gugi View Post
    var vector CalcViewLocation;
    Indeed, that works! Awesome.

    Originally posted by Gugi View Post
    Another possibility is perhaps to overwrite PlayerController::PlayerCalcView.
    I tried that, and it works, too; call PlayerController.Pawn.SpecialCalcView and supply empty out parameters. The results match with both CalcViewLocation and the actual in-game camera location. CalcViewLocation is clearly the preferred method.

    Thanks!

    Originally posted by Jrubzjeknf View Post
    What does the PlayerController's location give you?
    Last location the player spawned.

    Leave a comment:


  • replied
    What does the PlayerController's location give you?

    Leave a comment:


  • replied
    Well, from the source-code I think one of the following could help:

    I guess you could use the following variables in the PlayerController-class:
    Code:
    var Actor	CalcViewActor;		// optimize PlayerCalcView
    var vector	CalcViewActorLocation;
    var vector	CalcViewLocation;
    var rotator	CalcViewRotation;
    Another possibility is perhaps to overwrite PlayerController::PlayerCalcView.

    Leave a comment:


  • started a topic Check if player has line of sight? [solved]

    Check if player has line of sight? [solved]

    I'd like to check whether the player has line of sight to a particular location (to turn off ZTest in particle emitters).

    The camera's location seems to be the best guarded secret in the world. I can get the player's ViewTarget, but that does not give me the camera offset. If the player is in a vehicle and bBehindView=true, for example (or seeing through a translocator beacon, or viewing from a deployed SPMA camera or whatever), the camera can be quite a distance away from the PlayerController's Pawn or ViewTarget, with no real way of telling where it is.

    Any hints?
Working...
X