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"

attempted to access component but it is pending kill

alt text

alt text

When the AI gets hit by the bullet projectile, it takes damage to health and if it dies, Destroy the hitbox component, plays death animation once and after a 1 second delay the whole actor is destroyed.

AI has 100 HP and each bullet takes 40HP away. When testing it, sometimes works, registering 3 bullet hits (just enough to kill) even if I keep spraying my weapon. Other times, even after the hitbox component being destroyed (i toggled in game visibility for troubleshooting) and I keep spraying the gun, it keeps registering bullets, for whatever reason. Then after it shows those error messages.

The issue here is consistency. No event tick is involved in any of this, plus performance is steady at 120 FPS. I don't know what else to do.

Product Version: UE 4.20
Tags:
help1.png (157.0 kB)
help2.png (25.5 kB)
more ▼

asked Apr 20 '19 at 09:39 PM in Blueprint Scripting

avatar image

WATASHYY
1 1 1

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

1 answer: sort voted first

Its probably because multiple bullets are triggering the event in a very small amount of time so they sometimes trigger at almost the same time and call the destroy component node more than once. To counteract this, you could simply move your do once node to be directly after checking if health is less than 0.

Furthermore, you should probably check if the health is below 0 before applying damage since it doesn't make sense to take away health from a dead target.

Lastly, if moving the do once node does not work, check if the collision box is valid before calling the destroy component node on it.

Let me know if you have any questions.

more ▼

answered Apr 21 '19 at 12:41 AM

avatar image

Lolxh4
81 1 5 2

(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