Closed jacopomaroli closed 2 years ago
After almost one year I find out you already had an implementation which does what I described so I just reused that. It works like a charm and it reaches the construction spot flawlessy.
In the demo you just have to tweak a bit the radius in the Behavior Tree (IIRC is fixed to 50)
Thanks for the PR! :)
From https://answers.unrealengine.com/questions/558236/how-to-get-a-component-from-a-classdefaultobject.html
When you GetDefaultObject(), you get only the root component and you're missing all the subcomponents.
In our case this causes an issue when placing a building: when attempting to set the acceptable destination range in the blackboard, you'll always get 0 as that's what you get when you attempt to GetShapeCollisionSize of the building UShapeComponent (that you'll fail to get)
This code will first attempt to work as usual, but if it fails, it will try to get the subcomponents from the blueprint definition.
P.S. Commit history is pretty pointless. Happy to squash and merge