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"

Can't set Health of Bot?

OK so hears the thing I've made a gun that shoots ray traces, I'm trying to make the ray trace deal damage to a bot that I created. So hears the problem, I'm able to deal damage to the bot and I know the bot is receiving the damage, but when the bot receives the damage depending on if I plug the health variable into a or b pin of the float subtraction node the bot either dies instantly or in two hits ( no matter what the damage is set to ). Does anyone know whats causing this issue?alt text

Product Version: UE 4.21
screenshot-4.png (461.7 kB)
screenshot-6.png (371.8 kB)
more ▼

asked Dec 06 '18 at 10:48 PM in Blueprint Scripting

avatar image

3 1 1

avatar image CHADALAK1 Dec 08 '18 at 12:58 AM

One thing for sure, your check for health before death should be <= not >=. How is your fire function working? Is it possible your fire function is firing more than once?

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

1 answer: sort voted first

The subtract node is correct, you need to subtract damage from health. But then you should check if the health is less or equals zero, like that:


ah.png (128.5 kB)
more ▼

answered Dec 08 '18 at 11:50 AM

avatar image

2k 155 153 206

avatar image DragonFire1116 Dec 08 '18 at 05:54 PM

Oh my God thank you so much I've been trying to figure this out for several days now, the funny part is I did that originally but it didn't work because I didn't have the first part the way it is now.

avatar image Slavq Dec 08 '18 at 05:58 PM

Glad to hear that :) If it helped, can you please accept the answer? Thanks!

(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