So im making a tank turret system and I have chosen to use Motor6D’s for that. Everything works fine but when the turret starts rotating (im making it rotate by changing the Motor6D’s property values) it rotates the whole tank slightly with it. How do I make the Motor6D move only one part or should I just not use Motor6D’s for a tank turret system?
Could you show your code and the tank’s hierarchy?
I made a quick test, I created a model made of 3 parts, a body tank (block), a turret (cylinder) and a cannon (cylinder).
The turret is welded to the bodyTank with a Motor6D, and the cannon is welded to the turret with a weldConstraint.
Then I just tested it with a line in command bar and spins normally:
game.Workspace.Model.TankBody.Turret.C1 = CFrame.new(0,0,0) * CFrame.Angles(math.rad(45),math.rad(0),math.rad(0))
You didn’t say if the tank was rotating the same direction as the turret, or if it’s rotating opposite the turret.
What are the Densities of the tank body and turret?
If the turret has more Mass than the body then the body will try to rotate opposite to the turret.
I’ve used Motors instead of Motor6Ds to control my construction vehicles with good results.
My model consists of 2 models that are the tracks, welded to the base of the turret (or the body, whatever you want to call it), my turret is welded to the base of the tank with a Motor6D and my barrel is welded to the turret with a HingeConstraint.
Heres a video showing whats happening:
Also, my code only changes the DesiredAngle of the Motor6D. Nothing else really.
Its rotating opposite the turret. I do not have custom physical properties on so I dont know the density of the parts, however all parts of the turret are massless. Is it because all parts are massless?
I dont want to use Motors since they kinda seem to be really old and probably gonna get deprecated soon or something
I have tried putting a NoCollision constraint because I thought it was because of the friction, nothing changed. Changing the objects to have mass instead of being massless also doesnt change much.
When I set the base’s density really high, the tank still moves but a little bit less. I dont want it to move at all.
Disabling the HingeConstraint though made the tank move normally. I dont know why but whatever
The HingeConstraint to the barrel, or did you have one between the turret and the body too?
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.