I am making a VFX that rotates around the player. At first I tried to use welds but that rotated the player also. Then I tried to spin it using tweenservice and make it update the vfx position to the player but for some reason it wasnt moving and I figured that there probably is a better way to do it.
local vfx = ...
local speed = 0.5
local radiansPerSecond = math.rad(45)
local rotation = CFrame.Angles(0, 0, 0)
local offset = CFrame.new(0, 0, 5)
RunService.RenderStepped:Connect(function(delta)
vfx.CFrame = vfx.CFrame:Lerp(humanoidRootPart.CFrame * offset * CFrame.new(0, radiansPerSecond * delta, 0), speed)
end)
That made it follow the player but how do I make it constantly spin as well. I also found a new issue, when I play it in my game it goes under the floor and gets stuck there and is following me from under the floor but when I try it in a blank baseplate it doesnt do that.
Oops sorry mb, a small typo:
vfx.CFrame = vfx.CFrame:Lerp(humanoidRootPart.CFrame * offset * CFrame.Angles(0, radiansPerSecond * delta, 0), speed)
it just makes the orientation on the y axis go up and down slightly now