Floating skull mesh ((HELP))

Hi, I am trying to figure out how to make my Enemy_BP not only chase the player, but also float up and down while chasing. For example, if anyone has played Zelda, they have floating skulls, I’m trying to do the same thing. Any help will be greatly appreciated. Thanks

Also wanted to state this is for a side scroller game. Thought it would be easier due to only 2 directions it chases I should be able to add a go up and go down and repeat. Just don’t know how I would do that.

I have also tried Interp To Movement, but that stops the AI Perception and/or the Pawn sensing from working at all… They don’t chase anymore.

Hey there, if they float just visually then its easy to do, if its like an airborne object then its a lot harder. Assuming you are talking about just the floating up and down while chasing all you need to do is create a timeline that goes from 1 to -1 and multiply the output with the amount in space you want to float and set the mesh relative location z to that value. Once you reach a peak (1 or -1) you revert the timeline so it goes in the other direction. If i were doing this i would make it in a tick function instead of timelines, but timelines is simpler to do.

Add a Timeline, make it loop, add a float and make a curve, Set Relative Location of your Skull Mesh (Not Root Component) and use the the float for the Z Input. Start the Timeline at Begin Play.

Thanks, I will give that a try.

I’m not sure where I am going wrong. I’ll keep trying though.

Does anyone know why Pawn Sensing will not function if using Interp To Movement together?
Any timeline functions haven’t been working.

Check Sweep on your SetRelativeLocation.

okay, so that worked until he chases player. Then just glitches up consistently.

Here is a gif to show what I mean.

224289-help01.gif

Thats not enough info for me to figure it out. I can only assume you apply the same up and down motion to your root Component or reseting the timeline to play from start. One of those.

Not sure how to reset it to play from start again.

Okay, I got it. Had to change the connector from On Success to Play from Start instead of Exec to Play from Start.

This was also correct. I needed to set my Lerp A to 10 & B to -10. Thanks