Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to get player ID/Index number

I'm looking for a simple way to taking the output of a line trace and finding the hit actor's player ID number to reference when using the get player character or get player pawn nodes. I need to perform a server-side action on the specific character hit by that line trace.

My current method is the equivalent of using duct tape on a leaking boat, but it's getting the job done (including this in screenshot in case someone needs results quick and dirty).

alt text

Product Version: UE 4.18
capture.png (181.5 kB)
more ▼

asked Mar 31 '18 at 01:08 PM in Blueprint Scripting

avatar image

10 5 5 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

UE4 don't really relay on those IDs, instead it using references and from pawn you can get controller possesing the pawn and from there you can access any aspect of player and this is what you should do too. In order to use IDs you need to set them first with this node:


more ▼

answered Mar 31 '18 at 01:32 PM

avatar image

37.3k 936 172 1116

avatar image Micke879 Mar 31 '18 at 02:00 PM

I tried this approach, but I presume it just wasn't supposed to work after a few failures, until I read what you said and it clicked. Sometimes that's what it takes; thanks!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question