How to make an actor rotate towards another actor's forward vector?

Hey all! I’m trying to make a simple falling tree mechanic when the player chops one down. It works pretty good but I’m trying to use the players forward vector for the direction to fall too.

That way the tree will always fall the way the player is facing. I’d prefer to not use physics or tick, so the lerp is what I’m using right now.

Here’s what I got. It seems pretty random which way it falls though. Any help appreciated.

Hello! Took a quick 'n dirty shot at solving this for you :slight_smile: [you can find my BP snippet here][1] (just drag-select all, CTRL+C then CTRL+V into your UE4 graph).
I tried to explain my thought process in the comments of each node. I have an Arrow Component as a stand in for your player’s forward vector, so you’d have to replace it with yours.
While this will get the job done, I’m pretty sure there’s a more efficient way to do it that would not require you to inverse transform that Rotator so let me know if you end up coming up with one :slight_smile:
Cheers!

292068-timber-fall-away-from-a-forwardv.gif

Hmm I tried to get this to hookup with my setup but it just rotates in place? I’m using HISM for my trees to save on resources if that could be a reason why? Thanks for your help thus far though…

Could it be because you’re feeding it to the Roll instead of the Pitch of your LerpB? (Not sure how your tree’s pivot is set up)

Hmm. I’m using a custom character I’ve made and the trees are instanced do you think the forward vector could be getting confused somewhere along the way?

I had to change it up quite a bit to get it to work with my instances

Depends on which component you’re getting the forward vector from. If, for example, you’re getting your forwardV from Root but you are instead rotating a Capsule Component for movement, then you may not be getting the right forward (it will probably always be 1,0,0); so make sure you’re pulling the forward vector off the right component.
Another thing you can try is seeing if the method works on a non-HISM actor, that way we can isolate the problem a bit further.

I’d use the “Rotator from Axis and Angle” node for this.

The axis could be the player right vector, so you rotate either towards or away from the player. Angle would be either positive or negative and could also come from a timeline.

See this post here:
https://forums.unrealengine.com/community/general-discussion/1530175-rotation-around-custom-axis

I tried making something similar a few weeks ago but ended up using physics (used a vector from player to tree and applied rotational force so the tree falls)…

Let me know if this helped you or if you need further help :wink:

hey, if you see this. Can you plz relink this if possible? I am trying to make this but am not able to figure it out…