I don’t understand but I can’t seem to stop running into relative part positioning! Basically I am trying to position a part consistently on a certain part of the arm (the video below has just testing values, realistically it will be positioned more or less in the right grip attachment position). The problem is if I turn / move the position changes when I use the ability again to summon another part its different. I have tried welding differently, positioning relative to other parts, using cframe instead, nothing seems to make a working outcome. Here is a video showcasing my issue:
Here is my code (for the part positioning):
local tool = script.Parent
local ServerStorage = game:GetService("ServerStorage")
local TweenService = game:GetService("TweenService")
local ModelsFolder = ServerStorage.Models.divineBlast
local RemoteEvent = tool.divineBlastEvent
local hitbox = ServerStorage.Hitboxes.divineBlastHitbox
local reverseShockwave = ModelsFolder.divineBlastReverseShockwave
local energyBall = ModelsFolder.divineBlastBall
local energyLaser = ModelsFolder.divineBlastLaser
local pointlight = ModelsFolder.divineLight
local reverseShockwaveTweenInfo = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
local energyBallStartTweenInfo = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
--local energyLaserStartTweenInfo = TweenInfo(0.25,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
local energyEndTweenInfo = TweenInfo.new(0.5,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
local pointLightTweenInfo = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
RemoteEvent.OnServerEvent:Connect(function(player: Player, eventType: string)
local character = player.Character
local humanoid = character:FindFirstChild("Humanoid")
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
local rightArm = character:FindFirstChild("Right Arm")
local energyBallPosition = rightArm.RightGripAttachment
if eventType == "BlastStart" then
local energyBallClone = energyBall:Clone()
local pointLightClone = pointlight:Clone()
local energyBallWeld = Instance.new("WeldConstraint")
energyBallClone.Position = rightArm.Position + Vector3.new(-1, 0, 0)
energyBallClone.Parent = character
energyBallWeld.Name = "EnergyBallWeld"
energyBallWeld.Parent = rightArm
energyBallWeld.Part0 = energyBallClone
energyBallWeld.Part1 = rightArm
local energyBallTween = TweenService:Create(energyBallClone,energyBallStartTweenInfo,{Size = Vector3.new(1,1,1)})
energyBallTween:Play()
end
--RemoteEvent:FireClient(player)
end)
Any help or tips are appreciated!