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

Change a part's CFrame while following the mouse?

I'm trying to make it so wherever your mouse goes, the part follows it. So far it's good, but the problem is that the mesh seems to be positioned the wrong way. Since the mesh inside the part is a ring, part of the ring is going through the ground. Here is the chunk of code:

while true do
	wait()
	nukeTarget.CFrame = CFrame.new(character.Humanoid.TargetPoint.X , 1, character.Humanoid.TargetPoint.Z)
end

Is there any way to make it so the ring looks flat?

1 answer

✓ Accepted answer

Simply rotating it should do the job. Thought I don't know how fast is the TargetPoint. Personally I'd use mouse.Hit.

nukeTarget.CFrame = CFrame.new(character.Humanoid.TargetPoint.X , 1, character.Humanoid.TargetPoint.Z)*CFrame.Angles(math.pi/2, 0, 0)

1 comment

0

Yeah I tried using CFrame.Angles to make it work, but the problem with that is that the ring disappears.

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