I was using this module in order to make a fake arm that’s being tweened capable of dealing damage. I used the SetPoints method in order to set the points that I want the rays to cast from and this is what ended up happening:
https://gyazo.com/b243cda699601754b0e031379588d267
I originally thought that I made a mistake when setting the location of the points then I instanced some parts at those positions and I got this which is what I wanted.
https://gyazo.com/b937f6056ae72c9c011318465bc1e3f8
I’m assuming this problem is to do with the Arms position and size being tweened but I can’t figure out why it’s happening. What I wanted to happen was for the arm to tween in the forward direction and and the rays to move in the same direction as the arm.
My code is pretty much the same as the intermediate examples on the wiki apart from the following lines
local pointsTable = {Arm.CFrame:PointToWorldSpace(Vector3.new(0,0,-Arm.Size.Z/2)),Arm.CFrame:PointToWorldSpace(Vector3.new(0,Arm.Size.Y/2,-Arm.Size.Z/2)),Arm.CFrame:PointToWorldSpace(Vector3.new(0,-Arm.Size.Y/2,-Arm.Size.Z/2)),Arm.CFrame:PointToWorldSpace(Vector3.new(Arm.Size.X/2,0,-Arm.Size.Z/2)),Arm.CFrame:PointToWorldSpace(Vector3.new(-Arm.Size.X/2,0,-Arm.Size.Z/2))}
newHitbox:SetPoints(Arm, pointsTable)
local goal = {}
goal.Size = Arm.Size + Vector3.new(0,0,80)
goal.Position = Arm.CFrame:PointToWorldSpace(Vector3.new(0,0,-40))
local tweenInfo = TweenInfo.new(0.15,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,true)
local tween = TweenService:Create(Arm, tweenInfo, goal)
tween:Play()
Thanks for the help in advance