Hey! I’m trying to make a game like everlife (free on steam) which is basically a fast-paced shooter that is based in all sorts of different dimensions.
You want to rotate the Part (or Model, doesn’t matter) by -90 degrees on it’s Y axis relative to it’s CFrame after being moved, but you’re just setting the Rotation property which is in world space, meaning relative to the world’s XYZ axes. Try
The math.rad stuff is because CFrames use radians and not degrees, and math.rad converts degrees to radians. You could also learn radians and just type -math.pi/2 instead, either is fine.
The * operator between two CFrames means to compute the result of transforming the left CFrame by the right CFrame. CFrame.Angles returns a CFrame with no position, so transforming by it doesn’t move the model but only rotate it. Applying a transform to a CFrame is always in that CFrame’s space, so since you already set the CFrame of the part, the line I modified should rotate the gun 90 degrees to the left, relative to how it’s already rotated.
If I were you though, I would completely delete that line and instead modify the Pivot of the Part (or CFrame, doesn’t matter) so it “naturally” faces forwards.