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. 

Why it doesn't work ? Basic health system

Hello everyone, I have a problem with my blueprint scripting. I starting on UE4 and I have created a basic health system who does'nt work.

My game is a tower defense, I have a turret who fire on the ennemi who enter it trigger. The blueprint of the projectile contains a variable called "Damage" with the value 1. alt text

And now there is the blueprint of the ennemi (called Mob). The variable current health contains the value 3. alt text I don't understand what I do wrong. Thanks you for reading this far !

Product Version: UE 4.19 Preview
Tags:
projectile-bp.png (307.7 kB)
mob-bp.png (405.0 kB)
more ▼

asked Feb 27 '18 at 02:02 PM in Blueprint Scripting

avatar image

Orseiko
31 2 5 10

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

3 answers: sort voted first

You haven't actually hooked anything up to the "Hit" event. Hook up the "actor" pin of the "Hit" event to the "cast to projectile BP", get rid of the "get all actors of class", then it should work. Right now that will not execute anything, if you print a string right after the Hit event you will see it doesn't execute because you haven't specified what "Hit" what.

more ▼

answered Feb 27 '18 at 11:16 PM

avatar image

Nebula Games Inc
5.3k 27 9 14

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

This might be wrong as I am new to Unreal 4, but you haven't set a target for the destroy actor at the end of the graph. Maybe set it to the Projectile BP

Let me know the problem in greater detail (ie the actual output compared to the expected outcome) and I may be able to help more.

more ▼

answered Feb 27 '18 at 09:49 PM

avatar image

AgentArachnid66
7 3 5 11

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

Thanks you two for your answer. Nebula you are right it so obvious now !

more ▼

answered Mar 01 '18 at 01:30 PM

avatar image

Orseiko
31 2 5 10

(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