I’m making an APC that has a turret, and the turret’s axis is controlled by the X and Y cylindrical constriants, and is controlled by keys.
I want the turret to point towards the mouse, but I’ve been struggling to find how I could do this with the constraints.
I’ve tried setting the cylindrical to a servo, and setting the target angle to the x direction from where the mouse is but this is all that happened:
Any help is greatly appreciated!
1 Like
azqjanna
(azqjanna)
June 24, 2025, 7:28pm
2
To help me understand which part you’re stuck on can you explain what you expect to happen as you understand it so far?
Scottifly
(Scottifly)
June 24, 2025, 7:32pm
3
Why are you using Cylindrical Constraints? HingeConstraints will do what you want since you don’t need the Slider section of the Cylindrical at all.±
You’ll get some good answers if you type make turret aim at mouse or “gun aim at mouse” or similar phrases into the Search tool up top.
You can disable the sliders by setting the limits to 0, and I have searched plenty of times with no results that match my issue.
Scottifly
(Scottifly)
June 24, 2025, 9:47pm
5
Yes, you can disable the slider, but why make it more difficult?
A Hinge has only 1 axis of movement and you can set it to Servo.
Also, since this is Scripting support you should copy/paste your script here so others can see how you are doing this. Remember to put 3 backticks (```) before and after it so it formats properly here.