The question is answered, right answer was accepted
How to Modelling A Tree which can fall on Unity?
i'm sorry if my question has been answered somewhere and sorry for my bad english language. i'm new here and get little bit confused when create tree on unity. but it has done. now my question.
it is possible to make the tree fall when we chop it down? and does another program like blender can make the tree fall too? if yes, does that tree must animate there or we can do it on unity after importing the asset without animated/animated?
i see some video and i see the tree has 2 part i think. 1 has branch/trunk in bottom and has cutted already. i see he/him drag to separate these tree.
oh and i see the game too like survival game, i love that tree when falling, half of the tree has fall, but half of the tree is still standing (bottom of tree).
i have search it on documentation,and then forum but only found script, i'm also found how to create a tree from tree creator, speed tree paint.
i cant find how to modelling/make own tree and these tree can fall. thanks
Answer by hexagonius · Feb 12, 2016 at 07:22 PM
I think it's a good solution to use the two-part-tree approach. model the tree cut in half. Put it together in Unity. Add colliders to both and additionally a Rigidbody to the top part with isKinematic enabled. When the tree is chopped down, set isKinematic to false and Add a force at the top so it falls off.
thanks for your answer hexagonius, but i'm still curious, can unity separate these tree when we make it from tree creator? and if i put it together on unity, should i create new prefab? so these 2 part will be joined when i move it somewhere. i hope this question dont bother you :)
ok, i'll try what you say to use rigidbody and set some is$$anonymous$$inematic enabled , i'll be back here to report with detail after i'm done. again. thanks for the answer.
I don't know about tree creator and runtime separation. depending on your needs its probably not needed. You could make the whole tree a prefab yes. $$anonymous$$ake the top part a child of the bottom part then.
well, i'm back, it seem i'm fail, but almost there. when i set Iskinematic = false, the tree fall already when the game start, when i set it true, the tree wont fall. i made script tree health, so when we hit it 4 - 5 times as example, it will fall. it fail because my tree is only 1 part. and i dont have 2 part of the tree. but the script has 2 part like you said.
1.push tree script. (it caused fall). i put it on parent empty object which contain child (the tree), correct me if i do wrong. 2. health script (for hit RayCastHit). i put it on tree or tree prefab.
maybe i must join this script into one script. because i only have 1 part, the tree. so after instantiate, i think the push/force tree fall after that. thanks. it solved. i'll continue my research on the tree for falling. if have solution, i will appreciate it and try it.
Follow this Question
Related Questions
How should I make Grass in HDRP 2020? 0 Answers
Tree chooping 0 Answers
TreeInstance is not working properly 1 Answer
Leaves do not appear on custom mesh trunk 0 Answers
Modelling for unity confuses me 1 Answer