First enable physics for tree.
For this make sure tree has collision, you probably need to overide its mass and enter of mass (all this is in mesh properties).
To test if physics works, enable gravity tree should fall.
When all that work, create blueprint that will have tree mesh.
Now you need trigger volume that checks if player is nearby. You can check that in event “begin overlap” of trigger volume.
Now making tree fall. First make it not fall until its time. Set default settings of tree to no physics. Not sure here what would do best, probably turning off physics, then enabling it in player overlap is easiest.
When you overlap trigger, turn tree physics on, and add impulse. Remember to check “change velocity”. If you dont want to do it with change velocity you need add impulse from event tick for several ticks.
Or just offset center of mass for tree, it will fall down self.
For simulating different tree fall directions you need to do some smoke and mirrors trick. (i think this will be best solution for you, but first play with above as its easier to implement):
- create blueprint that has invisible collision mesh That is asymmetric (has one side bigger, like added asymmetrical box on top of long symmetric box), use this for all trees
- that collision box will be your physics tree, use gravity method from above part to make it fall.
- then add static mesh that is purely visual, this should have mesh without collision or physics, that roughly fits collision mesh
Finally to make tree fall where you want:
- find direction that player is coming from, you can do it on begin overlap, find vector from tree to player, use look at rotation to find rotation.
- rotate collision mesh in way that asymmetrical mesh is facing directiontree should fall.