- Home /
How to attract moving object to specific areas
I have a tree system in my game that allows me to interact with and cut down the trees. The trees all have three mesh objects the trunk that falls, the stump that's left and a small piece in the middle that disappears as being chopped. My current problem is when I go to cut down a tree I have to hit randomly on the tree to find the right spot. I have tried activating animations through scripting when close but sometimes the player is higher or lower than normal. How can I get certain weapons to line up with the right spot? Thanks for any help.
Pretty nebulous question without particulars like how you are moving your chopping tool. You have two approaches:
$$anonymous$$ake the area that detects chops larger. This might be by increasing the collider size, or by having the area that disappears detect the chopping tool and using proximity.
Have the chopping tool drawn to the disappearing area. This will depend on how you've implemented the tool. $$anonymous$$ight be as simple of using some AddForce towards the area.
Well my weapon movements are mainly based on a complex spring physics system not traditional animations but I can still use animations at any time. I'm currently trying to figure out a method for using a small collider on the end of the specific weapons I use for the cutting and making them "seek" the spot to be cut while using a chopping animation. I'm currently at a loss for the seeking part lol.