Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Change a part's CFrame while following the mouse?

Asked by
Cizox 80
10 years ago

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

Log in to vote
0
Answered by 10 years ago

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)
0
Yeah I tried using CFrame.Angles to make it work, but the problem with that is that the ring disappears. Cizox 80 — 10y
Ad

Answer this question