1. How do I make the player switch to the idle animation when the player stops running?
2. How can I make the tree get destroyed when the user presses the space bar (to attack)?
https://drive.google.com/file/d/1RHvus6ukhTpQHdZpMCnyGDCbb__nWibD/view?usp=sharing
Can you stop posting the same two questions again and again?
Your character already switches to idle animation. And if you want an answer to the second question, you need to explain it better.
I'm clearly stated my problems
Develop games in your browser. Powerful, performant & highly capable.
1. it already works
2. Add Line of Sight behavior.
On Space pressed Player has LOS to tree : Tree destroy