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"

No Cast to MyCharacter_C, only MyCharacter

I try to cast to MyCharacter_C, but there is only MyCharacter and the variable that I'm trying to access doesn't accept that.alt text

Product Version: Not Selected
Tags:
more ▼

asked Feb 22 '15 at 01:15 AM in Blueprint Scripting

avatar image

Mr0dd
30 12 9 12

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

1 answer: sort voted first

Try using the "Get Player Character" node and plugging it into the "Object" input of "MyCharacter". Please note that this cast has to be in the chain of events too for it to fire!

more ▼

answered Feb 22 '15 at 01:20 AM

avatar image

KITATUS
2.3k 97 84 398

avatar image Mr0dd Feb 22 '15 at 01:35 AM

Thanks! That works fine now. My death handling is still not working, here's my death blueprint in MyCharacter:Blueprint

avatar image KITATUS Feb 22 '15 at 01:39 AM

Be sure to mark my answer as "Answered" as it helps with tracking purposes!

In regards to your death blueprint, I'd move the second half (After the first print string) to it's own event which you call after the health has been set. I don't understand why you have a custom event tied to the branch either as the "Event Hit" is an event all in itself.

What I would do would be do an overlap event (Not a hit event).

To debug your code, you could always use Breakpoints, which would be SUPER-HELPFUL for finding where you code is going wrong.

https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Debugging/index.html

avatar image Mr0dd Feb 22 '15 at 01:43 AM

sorry for bad quality but here's what happens in game. If you can't tell, after the character is supposed to die, the health meter just keeps going down.

Damage

damage.gif (2.7 MB)
avatar image KITATUS Feb 22 '15 at 01:48 AM

You should've really created a new Answerhub for this :P In your code where you "Set" health, first make sure that "Health" is Equal or less than zero (Float

avatar image Mr0dd Feb 22 '15 at 01:53 AM

Okay, I'll make a new one right now :)

avatar image Mr0dd Feb 22 '15 at 02:51 AM
(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