my projectile, Who inherits from a parent, spawns but doesn't move while parent projectile works perfectly

Hi, so I have a unit that shoots projectiles and it works fine. But when I try to shoot a projectile who inherits from the previous one, the mesh spawns but is just stuck in the air.

Initial speed is high (10,000), velocity vector is (1,0,0), mesh and capsule set to “movable” and movement component set to auto activate.

From my research, I found it has something to do with the inheritance, but couldn’t quite make out what is the fix. Any help will be appreciate.

Picture of what happens when I try to shoot the child projectile:

image

Yellow tracers are the projectile.

something to do with the inheritance

Could we see the parent component hierarchy? Can you share anything about the parent?


my projectile, Who is a child actor

Child Actor usually refers to an actor spawned by a Child Actor Component. Could you clarify what you mean, as this would be a very odd choice for a projectile, indeed. This is a Child Actor Component, for example:

image

Yea I used the wrong terminology. I meant the the projectile who is buggy, is and actor who inherits from a parent projectile.

Here is the hierarchy of the parent:

image

And this is the son:

image

Thanks, the hierarchy looks fine.

  • is it safe to assume that Shooting Trace has no collision?
  • is it safe to assume the collision of the Sphere is set up correctly on both?

Assuming the child works fine when not inheriting (right?), is there anything in the Construction Script / Begin Play of the parent?

Both the trace and the sphere has a collision (BlockAllDynamic), but that’s also the case with the parent class and it works fine.

“Assuming the child works fine when not inheriting”-Not exactly sure what you mean. The parent projectile works fine. There is no logic attached to the “beginPlay” in the parent projectile.

Update: I make the unit shoot one at a time to see better. Sometimes, the first few bullets work fine, then from like the 5th-10th bullet, the problem starts. Other times problem starts from the first bullet.

Imho, it sounds like a collision issue. Print the name of what the projectile hits, see what you get.

I am dumb. I called an “event hit” on the projectile that inherits, thus replacing the previous “event hit” logic of the parent. But, I forgot to but “destroy actor” in the new projectile as well. So the bullets collided with each other but weren’t destroyed. That was the problem.

Thanks a lot for all the help!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.