I have an actor blueprint that has a sphere collision, a mesh and projectile movement component. This is the parent actor, in which I have an event “On projectile Bounce (Projectile Movement)” which let’s say prints “Hello”. I created a child of this parent, then I created the “On projectile Bounce” event, and I want to call the parent function. The problem is that the option is grayed out.
I basically want on the child’s bounce event to call the parent’s bounce event.
The child inherits projectile movement component.
On this c++ component there is no method called OnProjectileBounce. It is a delegate which is broadcasted from the method HandleImpact to be implemented in blueprints.
\UE_4.27\Engine\Source\Runtime\Engine\Private\Components\ProjectileMovementComponent.cpp
“Call to parent” in this context is the parent of the ProjectileMovementComponent, not the parent actor you are trying to reach. What “call to parent” does is execute the parent version of an overridden method, which is not what you are trying to do here.
If the parent actor its projectilemovementcomponent bounces, the bounce event should also execute on the child actor.
Ok, I understood what you’re trying to say there.
So, I used a print string on the bounce event from the child actor and it did … nothing. The projectiles are just going through the walls. Why is that? How come the child’s bounce event does nothing? Is it because the movement component is inherited?
What I’m trying to do is to have a bullet parent in which the bounce event decides whether to penetrate the wall or bounce. And all the bullets will have that. I was just trying to save some time and perhaps some performance, and not create all these nodes in every single bullet’s blueprint…
Well if the projectile doesn’t bounce the bounce event will just not get fired. Not on the actor and not on the parent actor. This probably means that your collision has not been set up properly for the projectile, the walls or both.
Yeah… that was the issue…
I tried creating a custom event earlier, in which I would decide what happens to the bullet, then call it from the child’s bounce event. I’ll try it again.
As long as the projectile goes through the walls no event will be executed.
Best double check the collision shapes and the collision profile set for both meshes.
Thanks! The custom event I made worked really well. I guess I wasn’t careful enough and forgot about collision.
Thank you for the “call to parent” information! It was really helpful!