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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Cast to Character using Player State?

Hello,

I'm currently trying to run a script ("Game Over Screen") from the MyCharacter blueprint (see picture below) and I need to cast to it, because I'm in the "NewGameState" blueprint (it's my custom Game State). The only information that I have is the Player's State. Is there a way to cast to a Character using a Player State?

alt text

Product Version: UE 4.8
Tags:
bez tytułu.png (312.6 kB)
more ▼

asked Aug 20 '15 at 10:13 PM in Blueprint Scripting

avatar image

Bproof
85 14 16 95

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

2 answers: sort voted first

There is no picture , but i think this is what you need

alt text

test53.png (42.3 kB)
more ▼

answered Aug 20 '15 at 10:49 PM

avatar image

Mhousse1247
3.5k 152 29 318

avatar image Bproof Aug 20 '15 at 11:22 PM

Sorry, I'm a dummy (and a bit tired) ! I uploaded the picture and just realized, how simple the solution is (I forgot that the ForEachLoop outputs an array index that I can use in this case). Thank you very much :)

alt text

bez tytułu.png (168.5 kB)
avatar image Bproof Aug 20 '15 at 11:23 PM

But BTW, is there a way to use a player state to cast to a character, or is that impossible?

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

Player State does not know about Pawns.

Create a GameOver Event Dispatcher in the Player State for the trigger, and have the Character bind an event to it when possessed. This way you can have the Character react to an event in the Player State without the Player State having to know about the Character.

Event Dispatcher documentation: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/EventDispatcher/index.html

more ▼

answered Aug 21 '15 at 03:11 AM

avatar image

Acren
460 46 50 70

avatar image Bproof Aug 23 '15 at 11:13 AM

Thank you for your answer. Sadly, even with the documentation, I couldn't wrap my head around how these event dispatchers work and how I can use them as you've described. I'll use Mhousse's method for now, but if you're willing to help, I'd love to try your solution.

(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