Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make my mesh part rotate?

Basically I have been having this issue where a mesh part in my game will not rotate when a script tells it to.

I have a part, when you press E it summons in front of you and it goes flying foward using body velocity.When that part is touched another part is summoned right where that part was and it has to be rotated exactly as the part that was flying.The thing is though is that it goes to the position but doesnt rotate.All of this is done on a normal script and I do not recieve any errors.

I have tried doing this


local KatanaSliceEffect = game.ServerStorage.Effects["KatanaSliceEFFECT"]:Clone()
KatanaSliceEffect.Parent = workspace
KatanaSliceEffect.CFrame = CFrame.new(katanaSlash.Position) *		CFrame.Angles(math.rad(katanaSlash.Orientation.X),math.rad(katanaSlash.Orientation.Y),math.rad(katanaSlash.Orientation.Z))
KatanaSliceEffect.Anchored = true

I have also tried doing this


local KatanaSliceEffect = game.ServerStorage.Effects["KatanaSliceEFFECT"]:Clone()
KatanaSliceEffect.Parent = workspace
KatanaSliceEffect.Orientation = katanaSlash.Orientation
KatanaSliceEffect.Anchored = true

I have also tried doing this but it doesnt work and messes up a few things


local KatanaSliceEffect = game.ServerStorage.Effects["KatanaSliceEFFECT"]:Clone()
KatanaSliceEffect.Parent = workspace
KatanaSliceEffect.CFrame = katanaSlash.CFrame
KatanaSliceEffect.Anchored = true

But nothing works. If you have an Idea of what I can do or just tell me what im doing wrong than that would be very much appreciated! Thank you and have a good day.

1 answer

The last code is somewhat correct

Use CFrame for this problem.

for i = 1, 360 do
	katana.CFrame = slash.CFrame * CFrame.Angles(0, math.rad(i), 0)
	wait()
end

This discussion is preserved as it was. New answers, comments, and votes are closed.