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"

How do i destroy my character and his sword with a trigger?

Hello, I have a character holding a sword and when he enters my trigger he should transform into another object/character. The problem is when my character enters the trigger he will transform but the sword stays in the scene. How can i fix this, the character and his sword should be gone at the same time.

First image show before and after entering the trigger. -- second image shows the blueprint on the trigger.

Image 1

Image 2

I hope that I have provided sufficient information to get some help or tips. (:

Product Version: UE 4.18
Tags:
trigger.jpg (86.0 kB)
more ▼

asked Jan 13 '18 at 02:15 AM in Blueprint Scripting

avatar image

Yasuhi
3 1 1

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

1 answer: sort voted first

Hi,

You can use GetAttachedActors and call Destroy Actor on each of them to destroy all actors that are attached to your character. However, there is one serious flaw here with your logic. The way you set up the overlap event, it will destroy your player pawn whenever anyone steps on it! Unless you've done it on purpose, this is considered a bad design because regardless of who steps on that overlap box, the event will fire and your player character will get destroyed! It can be any other actor such as AI stepping on that overlap box and your player will get destroyed wherever it is! Instead, a good approach would be to first check who has stepped into that box and only execute the logic if that is your player actor. You can do this check with a Cast node. Here's the blueprint setup that you would need:

alt text

You can then spawn your particle effect after the character itself gets destroyed.

Hope this helps :)

more ▼

answered Jan 13 '18 at 03:02 AM

avatar image

Vizgin
1.3k 9 5 16

avatar image Yasuhi Jan 13 '18 at 03:22 AM

Nice! thank you for the quick response master learned a lot in these couple of minutes. It works great now!

avatar image Vizgin Jan 13 '18 at 04:08 AM

You're welcome ;) Please consider marking the question as solved by checking that checkmark next to the answer. It will help us better keep track of unanswered questions. 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