Jump to content

Reference of the actor aimed by the player


gulogulo

Recommended Posts

GetCrosshairRef, which I believe is a SKSE function. It'll work on anything that the crosshair is targeting though, regardless of distance. If you want to limit the range, you can include that in the script via GetDistance.
Link to comment
Share on other sites

Probably you could use a statement like "TargetRef = Game.GetPlayer().GetCombatTarget()" in a script. When used specifically in this way it returns the npc reference that your cursor is pointing at. I think it might work this way even if you haven't started a fight, but I'm not sure. Ie. I'm assuming that anyone within your sights would be considered as a combat target even if you haven't initiated combat.

 

Alternatively, use the function HasLOS in combination with GetDistance to achieve what you want.

 

Another possibility is IsNearPlayer which returns false if an object is definitely out of sight from the player, so if it returns true there's a strong chance that the player could be looking at the target, or in a position to do so.

 

of course, if they are actually in dialogue then you could simply use GetDialogueTarget.

Edited by steve40
Link to comment
Share on other sites

@HosokawaTakuya

 

Where can I find this GetCrosshairRef. There was something like that in Oblivion, but I cant find anything like that in Creation Wiki pages or i documentation of SKSE

 

@steve40

 

Thanks for the tips but it wont due. You see its for smell abilities. I want to learn the scent of an actor even if it is a bloody cold corpse.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...