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 an added component?

I'm trying to create a mirror that reflects a a beam of light when pushed into another beam of light. This is done with some sort of add component command I don't know the name of because I found it by dragging a static mesh into the Blueprint Graph, which then executes a Set command to give a name to the new component called "Light Ray". Right now, the other "beam of light" is just a box component of a non-functional Blueprint while the "reflected light" is a static mesh (specifically, a 50x500 pillar). That's all working fine as far as I can tell, but the problems starts when I try to move the mirror out of the light.

I also want the mirror to stop producing light when the mirror leaves the other beam of light. Right now I'm using an End Overlap event to trigger a Destroy Component command which targets the aforementioned Light Ray component with a Get function. This seemed to work without incident in 4.4, but in 4.5 it doesn't. As far as I can tell, the Destroy Component command still works on components that the Blueprint starts with (such as the mirror itself) but completely ignores Light Ray.

What do I do about this? I suppose I could have it start with Light Ray and then destroy it when play starts, or transform the static mesh when triggered instead of adding and destroying it, but that seems kinda sloppy to me. Is there a way to get Destroy Component to work on added components?

Product Version: Not Selected
Tags:
more ▼

asked Nov 09 '14 at 09:35 PM in Blueprint Scripting

avatar image

Avernale
21 2 3 3

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

1 answer: sort voted first

Nevermind. It turns out the problem turned out to be something else entirely. The Begin Component Overlap event that creates the Light Ray was being triggered twice for some reason, creating two Light Rays whereas the Destroy Component command could only delete one of them. I managed to fix it with a Branch, so now it only creates one Light Ray.

Sorry.

more ▼

answered Nov 10 '14 at 08:15 AM

avatar image

Avernale
21 2 3 3

(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