I have a script setup in child actor. It’s using the ‘Event Tick’ node so it should run every frame.
However, once I started game, I noticed that there is nothing happening at actor. I thought that I may have set something up wrongly so I added some string prints(for all the cases). However, nothing printed on screen. That made me sure that it’s just not being executed. So now my problem is - how to get the child actor’s blueprint code to get executed? Is there a specific node that I must use in the owner actor or some checkbox that I missed in child actor’s settings or somewhere? Or is it just a bug?
Check if you have enabled the actor to tick. From EventBeginPlay execute setActorCanTick to true. It might also be called something like enableActorTick.
Oh, that’s something I didn’t knew. I’ll accept your answer once I get it tested;)
EDIT. Nope, it still doesn’t execute the tick.
Another problem may be that your parent class has an event tick function (empty or not) and that is overriding the child’s event-tick function. Since you can only have one event-tick function, check to make sure there isn’t both one in the child and one in the parent.
What? And what to do to execute script every frame for both of graphs - child and parent?
Every tick in the parent, call a function MyTick in the child.
You make this function MyTick yourself.
So here comes my next question - can I execute a function that belongs to a children? If not, than can I get children actor’s variables in parent?
Of course you can. Just drag out a reference from the child and write the name of the function. Then you have called it.
The function doesn’t show up there.
Di you make it public? If you did it should be there.
Remember that you cant call the actor component or just the actor. You have to cast the actor first.
I’ll look at it more and tell you how’s it going;)
Hi! Casting allowed me to get to the function, however - it still didn’t solve it. I add the function to be executed every frame, but it just doesn’t execute. The string isn’t printing and line trace isn’t showing the debug. I tried both - play and simulate modes.
Can you show me the functions? Full screen shot please. Just puush them and send link them here.
I’ll do it once I get a moment…
This solved it for me, the accepted answer: