Download

Add an additional collision cylinder?

My enemy AI are animals and currently their heads poke out of their collision cylinders. Is it possible to add an additional collision cylinder, which I can use for the front part of their bodies?

Thanks in advance.

Don’t think that’s intended, but might be possible. There should be a couple of threads covering this already.

But why not make the collision cylinder you have bigger? Sure it won’t be aligned as well anymore but you’re probably using traces for anything more complex anyways?

UnrealEverything: making the cylinder bigger can lead to undesirable results. the most obvious being that the Pawns feel much thicker (have more trouble going through doors, will collide more often against walls, etc), and the horrible visual artifact of having a pawn at a ledge, held by a thin margin of the collision, and visually looking like it’s flying.

Coldscooter:
I did this recently but maybe not exactly the way you’d think.
my second cylinder is an additional actor attached to the Pawn, and it doesn’t block actors (it only detects collisions on Touch). so things can go inside it unlike the regular collision cylinder, so my 2nd cylinder is quite thicker than the regular one.
the handling I do entirely on the Tick but doing it via Touch() would work as well. there I tell my pawn to stop moving, push other actors, etc.

the one trick that made it work btw, is that the actor isn’t attached with SetBase. instead, it calls SetLocation(thePawn.location) every frame.
the reason for the above is that unreal will only register collision events when something moves. if you collide against a wall or furniture that isn’t moving, since the 2nd cylinder isn’t really moving (having a base doesn’t count), then it wouldn’t register the collisions.

Thanks for the responses. Good to see you guys on the new forum.

@Chosker that’s not a bad idea. Seems a little hacky, but could work well for what I need. It would be much nicer if I could attach another collision cylinder though. Is the collision cylinder logic handled in native code?

the problem is that an actor can only have one collisioncomponent, so even if you add more components they will never register collision events (only exception is to trace against them using TraceComponent() but I don’t think you want to do that)

the collision cylinder is just a cylinder volume, which is assigned to be the collision component. there’s nothing special about it

the solution is indeed a bit hacky but over years and multiple attempts this is the one that gave me the best results, specially for collisions against physical actors.
being able to control what happens with the collision without the physics engine kicking in really gives you control over things. it’s the only way I could properly avoid physical things flying out of the Pawn’s way when he touches them (because with rigid body collisions, by the time the collision happens it’s already too late)

I have the same problem with the horse, the cylinder leaves out the head. I was thinking about to use a simplified physics asset and then set the collision to mesh. Then when enters in ragdoll, change the physics asset again for the more accurate version.

ive used the physics asset for collision on pawns before and it works well for detecting hits,ie-you can shoot between the legs and not hurt them but it doesn’t work for collision between the pawn and world.so depending on what you want it for this may or may not be the way to go.