Hi,
I’m creating a Car like this
EntityBase {
id: car
entityType: "car"
MultiResolutionImage{
id: carpic
source: pickCar(1,7) //this function just picks a diffrent sprite
anchors.fill: parent
}
DropShadow{
anchors.fill: carpic
horizontalOffset: 5
verticalOffset: 10
radius: 3
color: "#aa000000"
source: carpic
}
MovementAnimation {
id: animationrightleft
target: parent
property: "x"
velocity: generateRandomValueBetween(-50,-100)
minPropertyValue: 0
onLimitReached: {
car.removeEntity()
}
}
BoxCollider{
anchors.centerIn: carpic
categories: Box.Category1
collidesWith: Box.Category2 // Cars can't collide with eachother let only collide with ball
}
}
and im creating them dynamically in my Scene. Problem is the Boxcolliders just appear on top of the screen. They are moving with the cars but on the wrong position. How can i center them correctly on the cars?
Thanks in advance
Rob