How to assign an actor to destroy when pawn walked into a box trigger?
In the level BP, I can’t find a method to … like getting a specific actor.
I’ve considered casting to a specific actor class, but then if there’s multiple instances on that map, all instances will disappear instead of only that one.
Besides, I’m not sure I’m using the correct function… should I use “destroy component” in this case?
In your level, Click on the actor you want to destroy. In your level blueprint with your actor selected, right click and you will see “Create Reference to selected actor” or similar. The trigger box must also be in your level, and on Component hit, or begin overlap you can drag your Actor Reference to the Destroy actor Node.
Any Quests just ask.
I used destroy component for the sprite actor and destroy actor for the trigger box after used and it works just as I expected. So great thanks! :))
But I just wanna know, since I feel like I´m not totally getting what´s the difference between destroying component and actor even after reading the document. Would u mind to clarify the idea for me?
Cheers.
In General Components are things that get attached to an Actor.
Actors are placed in the world. Pawn is a type of Actor that can be controlled. Character is a type of Actor that can receive input. Your character is an actor, an exploding box would be an actor. A component is attached to the actor. A component can be a camera attached to an Actor. It can be a Component Type as an Emitter.
When you create an Actor Blueprint ( in your content browser rightclick and create blueprint class and select actor) Open that blueprint and upper left corner you will see green button Add Component. There are many types of components.
If my Character had a weapon i would make the Component a Child Actor of my Character.
I could also make Various components be the different parts of my Mesh. And give them Health.
For example I could have a mesh component for my left arm. after so much damage i can Hide it to give the impression my arm is missing.
I see. so if there’s only one render component in the actor, destroying it would basically equal destroying the whole actor… am I right?
Pretty much, However if you wanted you could just hide the render component (Set Visibility) and then us a delay and unhide it for continued use.