Hello i have an spaceship with an triangular shape and first tried a circle collider but cant get it to work i tried this first:
CircleCollider {
id: shipCollider
radius: shipSprite.width/2
collisionTestingOnlyMode: true
anchors.fill: shipSprite
categories: Circle.Category1
collidesWith: Circle.Category2
fixture.onBeginContact: {
console.log("collisionShip")
}
}
The collider is nice and centered on my sprite but its to big so i tried to change to:
CircleCollider {
id: shipCollider
radius: shipSprite.width/3
collisionTestingOnlyMode: true
anchors.fill: shipSprite
categories: Circle.Category1
collidesWith: Circle.Category2
fixture.onBeginContact: {
console.log("KollisionShip")
}
}
But when my collider isn’t centered on the sprite anymore it sits in the top left corner, what do i have to do to center it in the middle?