I'm trying to make a shield move from it's base. The script works fine as it is but I'm planning of having a lot of these 'shields' around the map and instead of going through each one putting in their position, I'm wondering if there's a way to CFrame a brick from it's current position, so no matter where I put it the shield part will move up 3.
local HoloShield = script.Parent.HoloShield for i = 0, 3, 0.1 do HoloShield.CFrame = CFrame.new(-64.5, 1+i, -121.5) wait() end
Thanks.
You need to CFrame the shield relative to it's current CFrame, and multiply it by an offset.
local HoloShield = script.Parent.HoloShield local offset = CFrame.new(0,3,0) local incr = .1 for i = 0, 3, 0.1 do local increment = offset * CFrame.new(incr,incr,incr) --Make it into increments HoloShield.CFrame = HoloShield.CFrame * increment --Offset by the increment wait() end