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 1 year ago
Edited 1 year 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 — 1y

Answer this question