1
\$\begingroup\$

I have an object in UDK, which has a SkeletalMesh. At certain times in the game, I want this object to continue rendering the SkeletalMesh, but I'd like it to use spherical collision temporarily.

After reading a bunch about PrimitiveComponents, my understanding is that UDK supports cylindrical and box-like collision, but not spherical without using a static mesh.

EDIT: What I have now is a StaticMesh with a material that makes it invisible. I've added a StaticMeshComponent to my Pawns. I can shut off the Pawn's collision, and turn on the StaticMesh collision. But it doesn't respond to impulses. I figure I'm missing something in how you turn on the RigidBody thingy.

CylinderComponent.SetActorCollision(false, false);
SetPhysics(PHYS_RigidBody);
RBCollisionComponent.SetStaticMesh(RBCollisionMesh);
RBCollisionComponent.AddImpulse(InImpulse);
RBCollisionComponent.WakeRigidBody();
\$\endgroup\$
1
\$\begingroup\$

It turns out that I just needed to set the CollisionComponent of the Pawn to be the StaticMeshComponent, and set all the collision channels properly. Also, changing the StaticMesh to use simplified spherical collision helped.

CylinderComponent.SetActorCollision(false, false);
SetPhysics(PHYS_RigidBody);

CollisionComponent = RBCollisionComponent;
RBCollisionComponent.SetStaticMesh(RBCollisionMesh);
RBCollisionComponent.WakeRigidBody();
RBCollisionComponent.SetRBChannel(RBCC_Pawn);
RBCollisionComponent.SetRBCollidesWithChannel(RBCC_Default, true);
RBCollisionComponent.SetRBCollidesWithChannel(RBCC_Pawn, true);
RBCollisionComponent.SetRBCollidesWithChannel(RBCC_Vehicle, false);
RBCollisionComponent.SetRBCollidesWithChannel(RBCC_Untitled3, false);
RBCollisionComponent.SetRBCollidesWithChannel(RBCC_BlockingVolume, true);
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.