Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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();
share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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);
share|improve this answer
    
You should accept your own answer. –  kurtzbot Nov 6 '12 at 19:28
    
There is a two day delay before you can accept your own answer. –  Almo Nov 6 '12 at 22:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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