Model not rotating correct

Hello, I have been playing around with the Y rotation of the cannon it self for about 1-2 hours and it keeps rotating in 180 degrees. Does anyone maby know why it is doing this ?

Video 1:
https://www.youtube.com/watch?v=a6mPCaciY14&feature=youtu.be (Maby know an easy fix to add a radius that the player can only go so much up and down ?)
Video 2: https://www.youtube.com/watch?v=ihEoqu960K4&feature=emb_title

local Rotation = Vector3.new(Cannon.Position.X, Mouse.Hit.p.Y , Cannon.Position.Z)
workspace.T1.Turret.Gun.Cannon:SetPrimaryPartCFrame(CFrame.new(workspace.T1.Turret.Gun.Cannon.PrimaryPart.Position, Rotation) *CFrame.Angles(math.rad(90), math.rad(0), 0))
1 Like

Anyone who know why it is doing this ?

Can you explain the issue more and what you are trying to do?

As you can see in the video the cannon of the tank should rotate up and down so you can shoot up and down. The rotation left and right is working cause of the turret, but what is happening is that the cannon is rotating 180 degrees and it’s locked in it’s position as you can see in video 2. Hope that made sense ?

Ok, so it looks like you are creating a CFrame located at the Cannon’s position, and you mare making that CFrame face towards the position called Rotation. The position called Rotation will always be directly above your cannon. Then, you rotate that 90 degrees, so the cannon will always be pointing straight ahead or behind (whichever is +90 degrees). Try to find another way to make the CFrame.