Why wont this tween work?

Here is the model
image

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")

Models don’t have a CFrame property either.

1 Like

Use gunmodel.Barrel for the tween creation.

1 Like

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
CFrame.Angles(360,0,0)

Unless this is outdated.

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

What shape is the barrel? If it’s a cylinder then a 90 rotation along the X axis might not change anything, have you tried manipulating the rotation along the Z axis instead?

1 Like

New error

Players.spydercam500.PlayerScripts.GunSystemLocalHandler:40: Expected identifier when parsing 
variable name, got '1'

What’s the error?

This text will be blurred

1 Like

This is the barrel
image

Oh, then any change should be noticeable, thank you for sharing.

Sorry i messed up. Change the loop to this.

for i =1,4,1 do

end
1 Like

@Forummer
@JamminRedPandaMan
I just remembered something that could be useful

Basically when you load into the game the whole gun welds to the Handle of the gun the welds are Motor6D’s i think this is why its not turning but how will i make the barrel turn if there welded to the Handle?
I cant just not have it welded otherwise it will just fall off onto the ground.