I have a character AI, that inherits from the character class and thus has a character movement component which i need. I have tried for a long time to make the AI moveToLocation function work when i have a custom mesh as root component of the character, and the standard capsule component included in the character, as child of the root component. It just wouldn’t work without the capsule component as root component.
So now i set the capsulecomponent as root component and the mesh as child component and it finally works: the AI moves. But the problem is that the AI now has the collision of the capsulecomponent and i want the custom collision of my mesh. Otherwise the pathfinding will not work that great, because the capsule is not in the right shape and all that.
No matter which collision i assign to the mesh, it just uses the collision of the parent, which is the capsulecomponent.
Does anyone know how to fix this? Having a capsulecomponent as root, but use collision of a child mesh?
An even better solution would ofcourse be not having the capsule as root but i don’t think that is possible, to make the pathfinding work.
EDIT:
This is how i have all my collision set up right now.
First of all this is my tank character component layout.
Next, i’ll show the capsule component’s collision.
As you can see, it’s collision is of type ‘Pawn’,and it is set to ignore collision of type Tank.
Next, i’ll show the collision of the Tank itself.
As you can see, it’s collision if of type ‘Tank’ and it is set to ignore collision of Type Pawn, but Block other Tanks
Next there is also the skeletal mesh which i don’t need at all so i just dont give it collision.
And finally there are also walls, which are set to block Tanks but ignore Pawns.
Based on the answer, this is what i came up with but it doesn’t work how it should be.
The tank can drive through walls without colliding with anything, and when 2 tanks collide, only their capsule components collide, but not the tank mesh itself.
Any help is appreciated.