The problem of just scaling drawsize and collision is that mappers use all kinds of values when they start scaling things.
That doesn't actually imply that the mappers well understand what they are doing.
An example of what I'm talking about is Nyleve:
There are 11 Tree5's in the map and they all have drawscale 3.0. However the collision height on them varies from 200 to 300.
If you try to jump on tops of those trees, you can quickly notice that 200 is insufficient half-height (you land inside the tree) and 300 is too big half-height (you land above the tree). The optimal half-height is close to 240 which is equal to the default.CollisionHeight (which is 80) multiplied by DrawScale / default.DrawScale (which is 3).
200 and 300 don't look like reasonable values.
It's very common for mappers to just start tossing numbers in that look good in editor so when I replace them I need to match up those figures to preserve site-specific things that may be happening.
What exactly do you want to achieve by matching up some randomly chosen values?
I tried to work around this by applying this to the ReplaceMe code
Code: Select all
A.SoundPitch = Other.CollisionHeight;
A.SoundRadius = Other.CollisionRadius;
How are sound properties related to collision metrics?
then setting the collision up within the tree itself once it was spawned:
Code: Select all
function PostBeginPlay()
{
local float H, R;
Super.PostBeginPlay();
SoundPitch = H;
SoundRadius = R;
SetCollisionSize(H,R);
Firstly, PostBeginPlay is called right in the Spawn function. When Spawn returned the reference to the newly spawned actor in the caller function, PostBeginPlay already have been executed. Hence, this part
Code: Select all
A.SoundPitch = Other.CollisionHeight;
A.SoundRadius = Other.CollisionRadius;
is executed _after_ A's PostBeginPlay.
Secondly, local variables H and R are not changed anywhere, so you basically pass zeroes to SetCollisionSize. Note also that SetCollisionSize accepts half-radius as the first argument and half-height as the second argument (not vice versa).
but it seemed to me like mesh collision would fix all of this.
SetCollisionSize should be sufficient unless you want to replace fast cylindrical collision model with more realistic collision model based on shape of the mesh.
I tried to set my trees to use mesh collision but it's being ignored.
If you do it right, it shouldn't be ignored.
or does the collision scale along with the mesh?
Mesh-based collision is scaled by DrawScale automatically.