Help on Tween Orientation/rotating direction

Hello!

While developping my game with TweenService, I have a part that is a CameraSubject

This video will show the tween.

robloxapp-20210503-1641120.wmv (724.1 KB)

The tween works perfectly fine.

But as you can see, the part turns to the right, not to the left. Can anyone help me and figure out the problem?

Part info:

  • The part while going in the vent, is at a Orientation of -180.
  • While turning, the part will go at an orientation of -90.

Thanks for reading.

Try replacing the Orientation of -180 to 90.

It works in a way but it just looks to the right.

How it is:

Goals = {
		Orientation = Vector3.new(0, -90, 0)
}

If you just change the -90 to 90 it’ll look to the left, right?

-180 is front, -90 is left, 90 is right. What I’m trying to do, as shown in the video, is to look at the part’s left. But what happens is, it goes around to look at the direction.

90 is just looking at the right

Are you using Enum.EasingDirection? Maybe change it to the opposite direction.

And if your not using it, use it :slight_smile:

I already use it and I changed all the types and the same issue is happening. Here’s the code:

local Info2 = TweenInfo.new(
	1,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)


local Goals2 = 
	{
    		Orientation = Vector3.new(0, -90, 0)

    }
	

local RotatePart2 = TweenService:Create(CameraPart, Info2, Goals2)

All you have to do is make the original Orientation.Z also set to 180 (flip it), and the Goals2 should be 0, -90, 180. Not sure why the EasingDirection is not changing it.

Orientation = CameraPart.Orientation + Vector3.new(0, 90, 0)
This code adds the current orientation of the part with a new Vector3 and what your code does it sets the orientation to exactly -90

I solved it. Finally. Bit complicated how I did

Can you tell me i’m quite curious

1 Like

So basically, before turning, we turn to -180 degrees, I changed it to 180, it turns around like the inital problem, but when we turn -90 degrees, it turns the right way. So, I just made it to turn to -180, then auto change it (without a Tween) to 180. Then it turns -90 degrees the right way.

1 Like

Enum.EasingDirection has no correlation to which way the tween turns. It instead determines if the Enum.EasingStyle will apply at the start (in), end (out) or both start and end (inout) of the tween.