Cone collider not detecting collider of type cylinder

in my archery game, the arrow has a cone collider at the tip of the mesh. The arrow also has rigidbody that is changed throughout the game lifecycle.
the target has cylinder collider and the ground has box collider.

when the arrow is shot the target is not detected, but the ground is detected.

my testing:

  1. swapped arrow tip collider type from cone to both capsule and sphere. Not resolved.
  2. increased the target cylinder collider’s height. Not resolved.
  3. multiplied the target cylinder collider’s radius by 10. Works. But does not scale with my model
  4. added complete new object with box collider. Does not recognize this as well.
  5. added rigidbody of type static to the target. Not resolved.

I will be attaching the arrow script for reference as well.

var ArrowScript = pc.createScript('arrowScript');

ArrowScript.attributes.add("drawDist", { type: 'number', title: 'draw distance' });

ArrowScript.attributes.add("drawTime", { type: 'number', title: 'draw time' });

ArrowScript.attributes.add("arrowSpeed", { type: 'number', title: 'arrow speed' });

// START

ArrowScript.prototype.initialize = function () {

    this.entity.collision.on("collisionstart", this.OnColiisionStart, this);

    this.app.on('aim:start', this.OnAimStart, this);

    this.app.on('aim:release', this.OnAimRelease, this);

    this.cam = this.app.root.findByName('Bow').script.bowControllerNEW.cam;

    this.isDrawing = false;

    this.drawTimer = 0;

    this.entity.rigidbody.type = pc.BODYTYPE_KINEMATIC;

    this.spawnPos = this.entity.getLocalPosition().clone();

    this.spawnRot = this.entity.getLocalEulerAngles().clone();

    this.arrowHolder = this.entity.parent;

};


// UPDATE

ArrowScript.prototype.update = function (dt) {

    if (this.isDrawing) {

        this.DrawArrow(dt);

    }

};

// DRAW ARROW

ArrowScript.prototype.DrawArrow = function (dt) {

    this.drawTimer = Math.min(this.drawTimer + dt / this.drawTime, 1);




    const z = this.spawnPos.z - this.drawDist * this.drawTimer;

    this.entity.setLocalPosition(this.spawnPos.x, this.spawnPos.y, z);

};

// onAim START

ArrowScript.prototype.OnAimStart = function () {

    this.entity.rigidbody.type = pc.BODYTYPE_KINEMATIC;

    this.isDrawing = true;

    this.drawTimer = 0;

    this.entity.reparent(this.arrowHolder);

    this.entity.setLocalPosition(pc.Vec3.ZERO);

    this.entity.setLocalEulerAngles(new pc.Vec3(-90, 0, 0));

};

// onAim RELEASE

ArrowScript.prototype.OnAimRelease = function () {

    this.entity.rigidbody.type = pc.BODYTYPE_DYNAMIC;

    this.isDrawing = false;

    this.drawTimer = 0;

    this.ShootArrow();

};

// SHOOT ARROW

ArrowScript.prototype.ShootArrow = function () {

    console.log("shoot arrow");


    var worldPos = this.entity.getPosition().clone();

    var worldRot = this.entity.getRotation().clone();

    this.entity.reparent(this.app.root);

    this.entity.setPosition(worldPos);

    this.entity.setRotation(worldRot);

    var camFwd = this.cam.forward;

   this.entity.rigidbody.applyImpulse(camFwd.clone().scale(Math.abs(this.arrowSpeed)));

};


// onCollision ENTER

ArrowScript.prototype.OnColiisionStart = function (obj) {

    console.log(obj.other.name);


    this.entity.rigidbody.type = pc.BODYTYPE_STATIC;

    this.entity.rigidbody.linearVelocity = pc.Vec3.ZERO;

    this.entity.rigidbody.angularVelocity = pc.Vec3.ZERO;

}

also forgot to include the project link (god bless for this feature!)

You want to enable CCD (as in continuous collision detection) for fast moving rigidbodies, so they don’t tunnel through thin obstacles. You can see how to set it up from this ticket:

You’d probably need to tweak values for CCD to match your needs.

Hey sorry for getting back late.

i tried your solution, but cant seem to get it work.
i found an alternative, that works for me:
applying 0,0,0 rotation to what ever the cylinder collider is a component of, and moving the arrow with transform. the arrow’s rigidbody is set to kinematic and hence the collision works and detects correctly.

Thanks for your time