I started a project with a friend and I'm having trouble tweening CFrame's in a skill. The idea is for the stick to grow straight in the hand of the charater, using tweening I managed to make it grow, but resizing the Z axis makes it grow both ways so to compensate I wanted to move the stick forward like this creating the effect of the stick growing to one direction. The problem is that the code just doenst seen to do anything at all.
local info = TweenInfo.new(0.2) local tween1 = tService:Create(rSkillEffectClone.PoleGrow,info,{Size = Vector3.new(11+(Yeoui.Value*1.5), 0.3+(Yeoui.Value*0.1), 0.3+(Yeoui.Value*0.1))}) local growCorrection = rSkillEffectClone.PoleGrow.CFrame * CFrame.new(0,0,(Yeoui.Value*1.5)/2) local tween2 = tService:Create(rSkillEffectClone.PoleGrow,info,{CFrame = growCorrection}) tween1:Play() tween2:Play()
The problem is on the growCorrection, no matter how I change the values, even if I add high values (like 10 studs) on Y axis, the stick doesn’t move. Only tween1 seems to work, no error messages appears on the output.
You didn't give the TweenInfo any properties except the time to tween.
Try this:
local info = TweenInfo.new( 0.2, Enum.EasingStyle. --The style you want then do a comma Enum.EasingDirection. --The Direction you want then do a comma --This is the number of times you want to repeat the tween then do a comma --This is if you want to reverse the tween, if you chose no to repeat do false put do true --This is the number of seconds that you want your tween to be delayed by ) local function tween() local tween1 = tService:Create(rSkillEffectClone.PoleGrow,info,{Size = Vector3.new(11+ (Yeoui.Value*1.5), 0.3+(Yeoui.Value*0.1), 0.3+(Yeoui.Value*0.1))}) local growCorrection = rSkillEffectClone.PoleGrow.CFrame * CFrame.new(0,0, (Yeoui.Value*1.5)/2) local tween2 = tService:Create(rSkillEffectClone.PoleGrow,info,{CFrame = growCorrection.CFrame}) tween1:Play() tween2:Play() end tween()
If this doesn't help, please comment below this!
I finally made it work, it got a little messy but these changes in the code led me to the desired result :)
local goal = {} goal.Size = rSkillEffectClone.PoleGrow.Size + Vector3.new((Yeoui.Value*1.5),(Yeoui.Value*0.1),(Yeoui.Value*0.1)) goal.CFrame = rSkillEffectClone.PoleGrow.CFrame * CFrame.new((Yeoui.Value*1.5)/2,0,0) local info = TweenInfo.new(0.2) local tween1 = tService:Create(rSkillEffectClone.PoleGrow,info,goal) tween1:Play()
I also did some changes on the skill effect model but i dont think its relevant