Is there a prohibition against scaling collision shapes at runtime?

Posted by Almo on Game Development See other posts from Game Development or by Almo
Published on 2012-11-20T22:44:26Z Indexed on 2012/11/20 23:23 UTC
Read the original article Hit count: 161

Filed under:

So, I have a StaticMeshComponent attached to an Actor:

Begin Object Class=StaticMeshComponent Name=StaticMeshComponentObject
    StaticMesh=StaticMesh'QF_Art_Powers.Mesh.GP_ForcePush'
    CollideActors=true
    BlockActors=false
    //Scale3D=(X=5, Y=1.5, Z=3) // ALMODEBUG
End Object
CollisionComponent=StaticMeshComponentObject
Components.Add(StaticMeshComponentObject)

Ordinarily, the actor gets spawned, anything touching it gets bumped, and the actor despawns itself. If I set the Scale3D as a default property, everything works as I expect.

But I want to scale it at runtime, like this:

function SetImpulseComponentTemplate(QuadForceBoxImpulseComponent Value)
{
    Local Vector ScaleVec;

    ScaleVec.X = Value.Length;
    ScaleVec.Y = Value.Width;
    ScaleVec.Z = Value.Height;
    CollisionComponent.SetScale3D(ScaleVec);
}

When I do this, the thing only collides as if it were not scaled. If I leave the actor spawned so I can see it, it is scaled. If I also "show collision", the collision displays correctly as well.

Is there a prohibition against scaling collision shapes at runtime?

© Game Development or respective owner

Related posts about udk