How to build a Pawn with dynamic collision shape?

Hey guys,
my goal: I have built a robot pawn which is controlled with the floating movement component. There is a gadget on the front that extends beyond the shape of the robot. This tool (e.g. claw) can change its length and should be able to interact precisely with physical objects.

My problem: I have already found out, that the root component is used as a collision reference for the movement and that I can also enter a static mesh with individualized collision there. But how can I make the collision dynamically adapt to the gadget if it changes its length, for example? Then there is the question of how I can include the dimensions of the grabed object in the collision query.

I have already thought about using the Dynamic or ProceduralMeshComponent to dynamically adapt the static mesh in my root. But this approach still seems very abstract to me, as I have never worked with GeometryScript etc. before. Do you have any advice on how to solve this problem?

Thank you in advance

I think just about your only way without c++ is to change the size of the collision at runtime.

Basically, pull the root component, scale it in the direction the claw extends.

If you have a collision loosely resembling the robot, then your base is going to stretch out as well, so you probably have to swap mesh at runtime at some point…

If you are using a skeletal mesh, then properly set collisione on the skeletal mesh + the dynamic animation would get the arm to collide and bend (not the root to stop moving into stuff as pictured).

Pawn movement / any movement and mesh are decoupled.

Hey @MostHost_LA ,
Thank you for your suggestion. After a few more tests, I have found a workable solution.
For example, if I add an additional SphereCapsule as a child to my root object, I can use the AutoWeld function (under Physics → Advance) to connect the collision properties to my root object. To do this, the physics on the root object must be activated. Since the FloatingPawnMovement component only provides the most important functions for movement, I was able to add my own functions to prevent my pawn from floating around in space or changing its camera rotation due to a collision, for example (activate gravity + axis constraints). All in all, I was able to achieve my goal and my problem is solved. :+1:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.