Announcement

Collapse
No announcement yet.

Attach actors to a Pawn?

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

  • replied
    I mean, I'm unsure what you mean by a separate blueprint for the armor plates. Also, thank you for the suggestion for a good system

    Leave a comment:


  • replied
    This is how I'd do it.
    Click image for larger version

Name:	n4qvRig.png
Views:	1
Size:	135.7 KB
ID:	1075319

    Leave a comment:


  • replied
    Thats what I'm trying to do but I don't know how

    Leave a comment:


  • replied
    Why don't you make a separate blueprint for just the armor plates. Create an integer variable and set it's default value to 5. Then create a on hit event, set the integer to subtract by -1 each time it is hit. When the integer value falls down to 0, set the simulate physics on and destroy the plates after x seconds.

    Leave a comment:


  • replied
    It would be helpful if individual components of a pawn could have their own event graph

    Leave a comment:


  • replied
    When the box is hit 5 times, it should detach from the parent. I'm just wondering if I need to make a separate variable for each box (I don't want them all falling off when one is hit 5 times, if you know what I mean)

    Leave a comment:


  • replied
    When the event is called, it will be "carrying" the value you set as an input with it from where it's called. Was that your question ? This input is the closest thing you'll have from a variable.

    Leave a comment:


  • replied
    I think I understand how it works, but Will the event share its own variables, or do i need to make a new one for each box?

    Leave a comment:


  • replied
    Small question, when you mentioned adding an input with an actor type, do I change NewParam to Object Reference/Actor or do I create a new actor with the desired script?

    Leave a comment:


  • replied
    Thanks for the reply, I'll try it out, and yes, I will try to develop a better understanding of how it works

    Leave a comment:


  • replied
    This is something you should learn for good so you should go and watch a few tutorials.
    I can give you a quick how-to since I imagine you're pretty impatient to see your stuff working, but you should really go asap and get a deeper understanding of this system.

    So you just right clic somewhere in your BP, and type "custom" from there, you'll find a "add custom event" node
    Place it, name it, for exemple "BoxHit"
    In the detail panel of that event, add an input, with an actor type. Call it "box" for example. You'll probably need some more of those later depending on qhat you want to do.
    Later, you'll plug this event in place of the hit event you currently have. And Use the "box" output as the actor you want to affect (detach or anything)

    COMPILE !

    Now it's created, you need to call it.
    From one of yout hit event, drag the execution pin, and type the name on your event, "BoxHit" from my example. You'll find it under "call function".
    It's created and called when the hit event is launched. Plug a reference to the box that's been hit in the "box" input you created previously.
    Repeat those two last steps for each one of your box.

    So yes, only the script itself will be unique and you'll still have to launch this event for each one of your box. But if you want to change the actual script, you'll only have to do it once. And maybe the event binding I talked about earlier is a solution so you don''t even have to do that, check if you have time.

    Leave a comment:


  • replied
    Okay, so how and where would I set up a custom event?

    Leave a comment:


  • replied
    With the custom event logic, you'd have to launch the event for each plate, but the actual script would only have to be written (or tweaked) once.

    Leave a comment:


  • replied
    Ok, so would I add the custom event to the pawn and connect it to the meshes of the plates? I just don't want to have to repeat the script 20+ times for each mesh.
    The script that I posted works, and is exactly what I'm trying to do but I just want to know if there's a way of making the meshes its own actor with one of those scripts I posted, so I can duplicate it over the ship and each mesh will act the same, but will be separate with its own variables. I tried an actor, and got the script working but I couldn't add it as a component to the pawn.

    I hope it makes sense
    Last edited by Bespingo; 04-21-2015, 05:54 PM.

    Leave a comment:


  • replied
    I'd go for a custom event too, but do anyone knows enough about "delegate" to tell me if that would be a good way to go ?
    Or with event binding ? https://docs.unrealengine.com/latest...ing/index.html

    Leave a comment:

Working...
X