Hit model to the exact position of other model

Hi, I want to hit the model to other model but its position is not set accordingly. Your help would be highly appreciated :slight_smile:

Hi @HasnainX,

I imagine this will be an animated/ skinned model?

In any case what usually most games do is represent the player body with a number of colliders or even a compound body. You can for example a sphere for the head, a capsule for the main body, cylinders for the arms etc

This way you can approximate relatively with precision the body shape and get collision results eg the position of a hit on the body.

Thanks and how can we access a compound body because this model is basically loaded with URL

Basically you need to add a collision and rigid body component to the entity that will hold that model.

Check the manual on how physics work:

https://developer.playcanvas.com/en/user-manual/physics/physics-basics/

And here is an example on how to set a compound collider in code:

https://playcanvas.github.io/#/physics/compound-collision