I wanted an eye ball chest that follows you. It blinks and the eyeball does follow but the only way I figured out how to make it work is have 2 actors. The eye lid part that blinks and the eye ball part that follows you. I could not get the eyeball rotations to work properly without rotating the entire actor so I have 2 actors overlapping each other. Here is the eyeball code.
They both have a trigger that when overlapped, you can attack and the chest will be destroyed. Problem is because the triggers are overlapping each other, sometimes they both don’t get destroyed. Only one does. So does anyone know how to fix that or can post a picture of code on how to get the eyeball to follow the player within one actor blueprint? Making just a component follow the player rather than the whole actor? Can I reference one actor when inside another? Like “if eye lid gets destroyed then destroy eyeball”?
I’d address this issue at its very core. This should be one actor. What exactly is preventing you from it functioning as needed? You have a hierarchy that can offset any component and / or use it as a pivot.
Also, you’re mixing a 100 times per second Timer with Tick’s delta time? Any reasons for that? Tick + Gate seems like a better overall choice here. And the way you access the Cast actor is unsafe and may simply stop working at some point.
Can I reference one actor when inside another? Like “if eye lid gets destroyed then destroy eyeball”?
This can be done even without referencing, with an Event Dispatcher. But you’d need to explain how those two actors make it into the game. Ideally, make it 1 actor, though - problem solved.
To answer the delta question. I don’t have an answer. I’m an artist first. But this is the video I watched to get this code.
As for why it’s not 1 actor. I tried using component rotations in place of all those get actor rotation nodes but the closest I got was the eyeball following the player but being slightly off. Like a lazy eye following the player. My other results were a constant spinning rotation and the eyeball following the player but inverse. Which for all I know could of just been the lazy eye one but backwards.
This was the only way I could make it work how I wanted it to. But now I’m finding out the solution to problem caused another problem. Lol
Ok so I had no idea you could drop one actor blueprint into another. I was thinking about what you said about making it one actor and was like "if I knew how then I would. this would be so much easier if I could just -drag- -drop- -my face =0- lol. I have no idea if this is going to cause another problem but right now it works how I want it to. One actor blueprint controls the blinking and gems popping out while the other controls the eyeball following the player. And now I can destroy it with everything else instead of trying to figure out how to destroy it simultaneously. In the end, as long as it works, it doesn’t matter how you get there.