I tried tweening this minigun to turn when shot but it didnt work heres the code i used
local barreltweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,-1)
local barreltween = ts:Create(gunmodel,barreltweeninfo,{CFrame = gunmodel.Barrel.CFrame * CFrame.Angles(360,0,0)})
barreltween:Play()
Here is error btw
TweenService:Create no property named 'CFrame' for object 'MiniGun'
1 Like
(Assuming the barrel is starting at 0 degrees) There is no visual difference between 0 and 360 degrees. Instead, try rotating 90 degrees, 4 times.
2 Likes
Forummer
(Forummer)
#3
If “gunmodel” is a tool instance then it won’t have the CFrame property.
1 Like
Try using orientation instead of CFrame.
2 Likes
If i use that then the orientation will get messed up when the camera moves though right?
(Im making a FPS framework for this)
Yes “gunmodel” needs to be a part or meshpart.
Tbh I don’t know, I’ve never done FPS stuff.
1 Like
The period got removed when i was trying to format the post the period is there in the script though so thats not it.
Btw variable for the gunmodel is this
local gunmodel = game.ReplicatedStorage:WaitForChild("MiniGun")
Forummer
(Forummer)
#11
Models don’t have a CFrame property either.
1 Like
Use gunmodel.Barrel for the tween creation.
1 Like
Forummer
(Forummer)
#13
If you want to tween an entire model I recommend taking a look at the following thread.
2 Likes
Ok that fixed the error but it still wont turn…
Now try 90 degrees, 4 times.
This text will be blurred
1 Like
How would i make it turn 4 times?
also its already looping on 90 degrees on the X axis so it should work but it doesnt turn?
Could you send your current code?
1 Like
local barreltweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,-1)
local barreltween = ts:Create(gunmodel.Barrel,barreltweeninfo,{CFrame = gunmodel.Barrel.CFrame *CFrame.Angles(90,0,0)})
barreltween:Play()
Wrap the last two lines in this:
for 1 = 1,4,1 do
end
1 Like