BodyGyro facing all the wrong directions

I’ve got a turret with a bodygyro in it with only force in one axis, as well as a hingeconstraint to prevent it from rotating, and this is what it does.

Theres even a debugpart thats CFrame is getting set to the CFrame.new(), and it’s facing the right direction.

Heres the code:

local angle = CFrame.new(turret.Rotater.Position, Vector3.new(mousepos.X,mousepos.Y,mousepos.Z))

turret.Rotater.BodyGyro.CFrame = angle

1 Like

That video doesn’t really explain what you are trying to accomplish, and you’re not entirely clear what the issue is with your post.
A BodyGyro will want to face in the direction it’s aligned to.
A HingeConstraint will need to be set up as a Motor or Servo to be able to change however you want to configure its Rotation.
We need items like:
How is the BodyGyro oriented in the Part that it’s in?
How is the HingeConstraint set up, and how is it oriented?
What forces are you applying to the HIngeConstraint and BodyGyro?
What triggers the changes you are applying?

I’m trying to make the turret face the mouse, simple as that. Thought it was pretty self-explanatory.

the hingeconstraints have no motor. I have not set them to either motor/servo. There is a limit of -75,75 on the angle but I’ve confirmed that is not the issue. I used to use hingeconstraints servo, which worked fine until the ship was angled, so it has nothing to do with the hingeconstraints. The bodygyro has 400000 force in only one rotation axis, which i have confirmed to be the correct one (since it is infact moving in the video). The CFrame is set every renderstepped, and the CFrame direction is correct since the debugpart is facing the right direction.

1 Like

So you’d only like the turret to rotate in one direction? How does that make it face wherever the mouse points since it moves in all directions.
From your video it seems that the mouse position is only picking up when it hits an object on screen, and you’re camera position is following the mouse as well, but only when it is over another object.
I’m guessing what you want is either for the screen to stay stationary and not move with the mouse movement, or for the screen to center on your mouse and for your turret to follow the mouse position completely + or - 75 degrees?

Do not worry about the camera, it’s working fine. The mouse is picking up a result, i’ve checked. Also, it’s a top-down game. 3 Directions are not needed and only the Y axis is necessary.

Have you tried not deconstructing the mouse position? Just use mouse.Hit.p, might or might not fix it.

Woops, meant to put

local angle = CFrame.new(turret.Rotater.Position, Vector3.new(mousepos.X,turret.Rotater.Position.Y,mousepos.Z))

Still no dice however.