I want to press R for rotate model but I’m stuck
here my code
thx for help
Is the issue that it isn’t rotating correctly?
In that case you want to change
Rotation = CFrame.Angles(Math.Rad(90),0,0)
to
Rotation = CFrame.Angles(0,Math.Rad(90),0)
So that it rotates on the correct axis.
when I press R for rotate it’s just rotate for 2 second and it go back to same position
It looks like in the line
local cf = CFrame.new(cast.Position.X,cast.Position.Y,cast.Position.Z)
the preview is being reset back to its default orientation of 0,0,0 since only the position is being set
to fix this, you have to include the part’s angle
for example:
local CFAngle = Preview.PrimaryPart.CFrame - Preview.PrimaryPart.CFrame.Position
local cf = CFrame.new(cast.Position.X,cast.Position.Y,cast.Position.Z)*CFAngle
It’s work! thank you for help (^_^)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.