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"

Problem with health being shared between blueprint instances

I've run into a really strange and annoying problem tonight when trying to spawn a second player for the first time. I have a single playable character BP at the moment for testing the basic mechanics, so I'm using 2 instances of it. The character spawns fine (no player controller attached at the moment) but if I try to attack it in any way, the character I'm using is registering the damage as well (though only the first character's health bar is depleting) and when the health drops all the way, both instances of the character die???

To make sure, I set the second instance to be set as Player 1 rather than player 0 and I've also tried changing all instances of Get Player Controller to Get Controller to avoid having them look at the same source.

The health is completely setup and managed inside the Character Blueprint, not the controller.

I think the issue is resulting from the way I'm creating an Object Reference for use throughout the blueprints.alt text

If this is indeed the case, is there a way I can modify this so that it doesn't tie to a specific instance like this? Or do I need to get rid of this and just manually cast the 20+ times throughout?

Any help is greatly appreciated!

Product Version: UE 4.10
Tags:
creference.jpg (52.2 kB)
more ▼

asked Apr 22 '16 at 05:27 AM in Blueprint Scripting

avatar image

SithHunter
95 8 10 12

avatar image Nick Jackson Apr 24 '16 at 01:45 PM

Which blueprint does this snippet belong to?

avatar image SithHunter Apr 29 '16 at 05:49 AM

Sorry Nick. This is from my Character Controller BP.

avatar image Nick Jackson May 01 '16 at 01:26 AM

I am not sure I follow you. Is it in Character BP or Player Controller BP? What's "Character Controller BP"?

It might be easier if you zipped up the project and uploaded it here (or google drive).

Zip up everything except the following folders:

 * Binaries
 * Build
 * Intermediate
 * Saved

That way, the content should be minimal. Also, please exclude Starter Assets from the upload. Make a note on whether or not they are required. I can always add a local copy before running the project.

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

1 answer: sort voted first

Make sure that when you cause damage, you check at the collision time that the hit actor is not the controlled pawn. (get controlled pawn). Inflict damage to that one only.

more ▼

answered Apr 22 '16 at 05:37 AM

avatar image

keyle
1.8k 66 27 90

avatar image SithHunter Apr 22 '16 at 11:49 PM

Thanks for the idea but I've gone that route just to make sure :)

(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