Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why are my parts going off course during a tween?

I am currently making a boat that you can ride using tweenservice. The seats on the boat are going off course during the tween. If you want I can send you a link to a gif of it. Here is the code if it helps.

local tweeninfo = TweenInfo.new(
	10,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)

local boatgoals = 
	{
		Position = Vector3.new(-463.559, -12.501, 427.098)
	}

local seat2goals = 
	{
		Position = Vector3.new(-460.384, -11.936, 423.088)
	}

local seatgoals = 
	{
		Position = Vector3.new(-463.726, -12.053, 427.403)
	}



local boattotreestween = tweenservice:Create(boat,tweeninfo,boatgoals)
local seattweentotrees = tweenservice:Create(seat,tweeninfo,seatgoals)
local seattwototrees = tweenservice:Create(seat2,tweeninfo,seat2goals)


wait(25)
boat.Orientation = Vector3.new(0, -38.37, 0)
seat.Orientation = Vector3.new(0, 141.63, 0)
seat2.Orientation = Vector3.new(0, -38.37, 0)
boattotreestween:Play()
seattweentotrees:Play()
seattwototrees:Play()
wait(10)
boat.Orientation = Vector3.new(0, -38.37, 0)
seat.Orientation = Vector3.new(0, 141.63, 0)
seat2.Orientation = Vector3.new(0, -38.37, 0)

Thanks in advance, Cozmo.

3 comments

0

try putting waits in between the tweens

0

Ok I will give that a go

0

I tried it with a wait of 0.5 seconds and that seemed to get me somewhere, but that means the seats are behind the boat. I tried it with a shorter wait but then it seemed to have little effect

2 answers

✓ Accepted answer

I would try a BodyPosition, Since your code involves tweening the parts separately, just Unanchor and weld the boat, and make your script change the position every x amount of time

4 comments

0

hello! When I do this, it causes the boat to rock around, otherwise it is fine, I think that is just the terrain. But yes this works.

0

How would i stop the swivel on the boat?

0

You use a bodygyro

0

to create a custom orientation, script the cframe using BodyGyro.CFrame

Make sure that the boat is anchored. Otherwise not sure

1 comment

0

I just anchored it now and it is still having the issue. I might just have to rewrite it I am not sure.

This discussion is preserved as it was. New answers, comments, and votes are closed.