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"

How i can cast to all Players on widget

Hi,

I want to send a variable from an actor to a widget. Unfortunately, a widget can not have access to replicated variables.

So I tried the following: I write the variable in all PlayerControllers. alt text But its dont work. It must be somehow possible to display the life display of another player in a widget.

Product Version: UE 4.14
Tags:
more ▼

asked Jan 16 '17 at 10:09 PM in Blueprint Scripting

avatar image

Dj EKI
36 14 10 16

avatar image elitereloaded Jan 17 '17 at 01:54 AM

What exactly are you trying to achieve? Are you trying to allow each player to view each other's health? If you are trying to allow all players to see each other's health you should store the player's health in their Player State object.

When you store the player health in the Player State you can get all Player State objects and iterate over them and render your UI health bars for each Player. All Player States are replicated to every machine (Authority and Client) because Player State is "public" data (unlike Player Controllers, which are only on Authority and the client machine that owns the Player Controller).

If you're trying to display the health of an enemy actor then there are multiple ways you can achieve that... Before I go into more details I need a clearer explanation on what you are trying to achieve.

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

1 answer: sort voted first

Add Owning Player into Create widget. alt text And after that. try to get player state form owning player pawn. alt text

more ▼

answered May 05 '19 at 02:30 PM

avatar image

CENSOR_31337
1 1

(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