I am trying to create a tank where the turret will rotate around the base, controlled by a slider. I have tried to use the revolutejoint to turn the turret, however this has unpredictable results where the turret turns, but the tank base also moves down and across the screen. Please could you advise how to use the joint correctly and whether this is the best course of action or if I should use another method?
The below code does not implement any controller, it’s just to try to get the turret turning… HELP!!
import QtQuick 2.0
import Felgo 3.0
Item {
id: tankWhole
x: 120
y: 200
TankBase{
id: tankBase
}
TankTurret{
id: tankTurret
}
RevoluteJoint {
id: revolute
maxMotorTorque: 300 * 32 * 32
motorSpeed: 1000
bodyA: tankBase.body
bodyB: tankTurret.body
enableMotor: true
}
}
-
This topic was modified 7 years, 1 month ago by
darrenbrown50@hotmail.com.
-
This topic was modified 7 years, 1 month ago by
darrenbrown50@hotmail.com.