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. 

Check if enemy is dead. Urgent

Hi I need some urgent help. I need my level blueprint to check whether an enemy is dead. I have a blueprint called hivetest(this is the enemy), ive set it up so that right before the hive is destroyed it sets a variable(hiveisdead) to true. In the level blueprint i need it to check whether the hiveisdead is true or false and if its true change the level objective. I have set it up but im not sure what it is that im missing if someone could just point me in the right direction as to what it is i need to fix I would greatly appreciate it. This is the hivetest blueprint. alt text

This is the part of the level blueprint where I want to check whether the hiveisdead variable is true or false. alt text

If there is any other blueprint you need me to post in order to understand where the issue is just let me know. Thank you for any help.

Product Version: UE 4.16
Tags:
help-ue4-1.jpg (66.3 kB)
help-ue4-2.jpg (77.0 kB)
more ▼

asked Nov 28 '17 at 08:22 PM in Blueprint Scripting

avatar image

OniricMaster
26 2 2 9

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

3 answers: sort voted first

The issue is that HiveIsDead is contained in the hive itself. If you destroy the hive, you are removing the variable, and the level can't reference it. You can do one of two things:

  1. Leave the hive in the game (don't destroy it) and set the visibility to hidden. This can be less memory efficient if you intend to garbage collect the asset.

  2. Store the 'hive is dead' variable within your GameMode (single player) or GameState (replicated) class. Then you call your game mode and reference the variable from it.

more ▼

answered Nov 28 '17 at 09:26 PM

avatar image

Nice_Rain
249 13 14 30

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

The first screenshot is form the actor HiveTest ??? if so you are destroying it when it dies, so it wont check the variable because it doesnt exist, maybe that is the problem

more ▼

answered Nov 28 '17 at 08:49 PM

avatar image

Daher
266 4 4 5

avatar image OniricMaster Nov 28 '17 at 08:55 PM

I already thought about that, I used to have the set hiveisdead variable right after the destroyactor, so i thought if i put it before the destroy actor it would work. But now that I think about it it still might be the problem. Any ideas I how i could do this a diffrent way? Thanks for the reply.

avatar image Daher Nov 28 '17 at 09:08 PM

Do not destroy it, it depends on your intended gameplay, but maybe you can add a delay with enough time to check for the variable or maybe you can destroy the mesh so its not visible anymore but the actor still exist, then destroy it with a delay with higher time, but first of all you should try if it works without destroying the actor to see if that is the problem

avatar image OniricMaster Nov 28 '17 at 09:35 PM

Ok so i tried doing it without destroying the hivetest and it didnt work so i figured i was just doing it completely wrong. I did a bit more research and actually found a thread which solved my problem. Now the only problem i have is that Im not sure how to make the hivetest dissapear cos it seems like destroying it is not an option. Any ideas?

avatar image Daher Nov 28 '17 at 09:38 PM

You can destroy the mesh component wich is the visual representation of the actor, the actor will exist but the hive will dissapear in game

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

Oh i found it i just set the visibility to none. Thanks man you pointed me in the right direction by telling that the problem lied with the actor being destroyed. Cheers

more ▼

answered Nov 28 '17 at 09:39 PM

avatar image

OniricMaster
26 2 2 9

(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