Announcement

Collapse
No announcement yet.

Disable a child actor from construction script.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Disable a child actor from construction script.

    Hey guys,

    Thought this would be easy, but I've been at it all afternoon.

    I have a child BP component that I want to activate/deactivate (visibility and collision) with a public variable from my construction script.

    I can't figure it out. I've tried Set Active - no effect. I can toggle the visibility (not without issue though, I seem to need to toggle it a few times to make it 'reappear'), but can't seem to set collision to turn it off.

    I feel I've tried it all: toggling actor collision, toggling mesh component collision, toggling set active. Casting to the child, applying visibility directing to the actor component. Nothing has worked.

    Is there an obvious way of doing this?

    Here's my most recent attempt. Visibility will toggle *sometimes* with this setup (Like it said, for some reason I need to turn it off and on a few times before it reappears - which isn't ideal). But the mesh is still being 'hit' by my trace (which I need it not do).

    Any ideas?

    #2
    I feel your pain, I have been struggling for 3 weeks now and just can't understand why my simple child actor component refuses to work.

    I made a simple holster BP that attaches to a skeletal mesh socket and allows me to holster weapons in VR. to my character body.
    The holster BP works just fine if I add it in my characters main even graph with the spawn actor node.
    It also works fine if I add it this way and collapse it to a function.

    But the great thing I like about being able to add it as a child actor component Is that it gives me a details panel and access to some of the variables inside that BP, allowing me to edit them on a per child actor basis.

    but when I add a child actor component from the drop-down list and select my holster BP as the actor, and attach those child actors to skeletal mesh sockets in construction script, they attach fine and I can see them detect when my hand enters the holster zone but they refuse to holster.

    I have asked this in the forums myself but Too many times I get lots of views and not a single answer and just remove the post.
    so I hope My issues shed some light on your own as I have also tried everything I know.
    its like child actor components are some dark art nobody wants to talk about , and there really is NOT alot of info on them from EPIC either.
    Last edited by AlphaWolF; 09-26-2018, 05:27 AM.
    Artstation

    Comment


      #3
      Thanks for the reply, at least I know I'm not alone (or crazy!).

      In the end, I've gone with a different setup. Like you say, there would be some definite benefits to parenting blueprints - but for myself (not a coder), just presents too many headaches.

      Comment

      Working...
      X