Parenting bullets

Hi all,

I am very newbie to Unreal 4, However i was devoloping with Unity for years. I am trying to parent an actor to another, maybe the best way to say is “make an actor became the component of another actor” into Unreal terms. The question is, I have a simple airplane firing bulltes, this is my script to fire bullets (basic)

When I fire, looks great

50658-fire1.png

When I turn, looks in this way

50659-fire2.png

This is the natural behaviour, bullets move into a “world” space, but because I want to learn other aspects of Unreal, I want the bullets to be parented to the airplane and move into a “local” space, so bullets will looks always moving straigh forward whatever I turn the plane (Yes, it’s not realistic, I know, I am just trying to understand all)

How can I accomplish this?

Thanks in advance
Jose

Hello @xpectral,

First off, welcome to UE 4! It’s pretty awesome over here.

But seriously, I think I can help you out. I think you are looking for the “AttachTo” set of nodes. They are used to parent one object to another. There are two main types of this node which are “AttachActorToComponent” and “AttachActorToActor”. The names are pretty self explanatory. By looking at the code you provided I would suggest using “AttachActorToComponent”. I created an example blueprint illustrating the use of this node and posted it below.

Here is my example Blueprint:

Important Side Note: You can change the “Attach Location Type” field in the “AttachActorToComponent” node to change the attaching behavior. You may have to experiment with this to get your desired behavior.

Hope this answer helps,

Farshooter

Thank @Farshooter, that’s works pretty good, every little step it’s a big leap for me with Unreal 4 :slight_smile: Day by day I love U4 more and more :smiley: