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

connecting 2 parts with a beam in between not rotating correctly?

Asked by 2 years ago
Edited 2 years ago

This codes works at placing the beam in the centre point between the tool handle and my mouse position to try creating a "beam attack" effect for my game that connects between the mouse and the characters hand. However when changing the CFrame the beam isnt rotated correctly so the beam is placed floating in the air horizontal in relation to the player. Any idea on how to make this work?

local midPoint = (tool.Handle.Position + mousePos)/2
beam.Size = Vector3.new(distance * 2,3,3)

beam.Position = Vector3.new(midPoint.X,midPoint.Y,midPoint.Z)   
beam.CFrame = CFrame.new(beam.Position, tool.Handle.Position)

Edit: I think part of the problem is that the front surface is looking at the tool but the front surface is the round part of the cylinder is there a way to get around this

0
Rotate the orientation 90 degrees boredlake 256 — 2y

Answer this question