Rocks moving in wrong rotation

I’m trying to get the rocks to move from the center to the side as they appear. Why does it move in the other direction depending on the orientation of the character?

I tried CFrame.RightVector and CFrame.new(0,0,-3) but it doesn’t help.


ts:Create(rock,TweenInfo.new(0.1,Enum.EasingStyle.Linear,Enum.EasingDirection.In),{CFrame = CFrame.new(rock.Position + (rock.CFrame.RightVector * 3))}):Play()


ts:Create(rock,TweenInfo.new(0.1,Enum.EasingStyle.Linear,Enum.EasingDirection.In),{Position = rock.Position + Vector3.new(0,0,-3)}):Play()

RightVector is relative to the part’s orientation, so make sure they’re really rotated in the correct way. You might also want to use for example the character’s HumanoidRootPart’s RightVector instead of the rock’s.

Assuming you want the rocks to look like 0:00 - 0:05 at all times, you want to use your character’s .RightVector and not the rock’s. Also, your second code: using Vector3.new(0,0,-3) defines a global position and will not account for the player’s rotation.

ts:Create(
	rock,
	TweenInfo.new(
		0.1,
		Enum.EasingStyle.Linear,
		Enum.EasingDirection.In
	),
	{
		CFrame = CFrame.new(rock.Position + (character.PrimaryPart.CFrame.RightVector * 3))
	}
):Play()

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.