x

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"

Custom Player Controller Reference

I have made an object reference variable in my HUD class to my custom player controller called "MyCustomPlayerController". I want my HUD to get a variable from it, but nothing happens because the reference is set to "none", how can I assign it at the "Begin Play Event"?

Product Version: Not Selected
Tags:
more ▼

asked Feb 27 '15 at 10:51 AM in Blueprint Scripting

avatar image

FluffyAmyNL
1 1 2 2

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

2 answers: sort voted first
more ▼

answered Feb 27 '15 at 11:07 AM

avatar image

Shadowriver
36.6k 932 169 1111

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

I cannot use Get Owning Player Controller for referring to the custom player controller. The solution to my problem was: alt text

bp.png (81.6 kB)
more ▼

answered Feb 27 '15 at 11:17 AM

avatar image

FluffyAmyNL
1 1 2 2

avatar image Shadowriver Feb 27 '15 at 11:27 AM

If it didnt worked means HUD was not assigned to player controller, you need to set HUD class in PlayerController, it will spawn it and set owner

avatar image FluffyAmyNL Feb 27 '15 at 12:10 PM

No, I meant it returned the PlayerController, not my Custom one. So I couldn't access the variables. I forgot adding the cast to ... so your solution works also:alt text

I think your solution is cleaner. Same for the HUD reference: alt text

bp.png (67.1 kB)
bp.png (42.1 kB)
(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