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"

Reference to Actor

Hello.

I created two progres bars. One for PiratShip and second for EnemyShip. PiratShip is C++ code GameMode and progress bar in blueprint working very good - this is my blueprint: ![alt text][1]

But i have problem with second EnemyShip blueprint. Enemy ship is C++ code Actor and progress bar for this one do not work ( no matter what i past as a object) This is my blueprint for EnemyShip - progress bar: ![alt text][2]

I have no idea what i should connect as an object. Could you help me please ? [1]: /storage/temp/119133-piratship_bp.jpg [2]: /storage/temp/119134-enemyship_bp.jpg

Product Version: UE 4.13
Tags:
piratship_bp.jpg (135.5 kB)
enemyship_bp.jpg (141.7 kB)
more ▼

asked Dec 17 '16 at 07:10 PM in Blueprint Scripting

avatar image

Milek
1 1 2 2

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

2 answers: sort voted first

You need to pass an instance to your EnemyShip actor that is spawned in the world as a parameter to "Cast To EnemyShip" . Or you can update your EnemyShip Actor so it stores a copy of it's Current and Starting Hull Durability in the GameState and replicate that to each GameState on the client. That way each client UMG widget can get an instance of the GameState and grab the information it needs.

Where is GetYourShipHullProgressBarPercent called from, the blueprint UMG (hud) Widgets?

Are you treating your GameMode like an actor itself where you can actually damage it and destroy it?

I would advise against getting the CurrentHullDurability and MaxHullDurability from the game mode directly. GameMode is only ever going to be available (non-NULL) on the Authority server. This means when you try to play multiplayer you will have issues because your client machines will not have a GameMode returned to them, instead they will be given NULL. Store that information in the Authority's version of GameState or PlayerController and replicate it to each client as a variable.

more ▼

answered Dec 17 '16 at 08:16 PM

avatar image

elitereloaded
694 24 24 55

avatar image elitereloaded Dec 22 '16 at 04:23 AM

Did you get this solution working for you?

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

Thank you for your help and sugestions. I gonna try to move it to GameState and I will se how it works.

Thank You.

more ▼

answered Dec 19 '16 at 01:06 AM

avatar image

Milek
1 1 2 2

(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