#AlignOrientation in 2 Axis. HELP

1 messages · Page 1 of 1 (latest)

crude granite
zealous grove
#

#1143220803287130224 message

crude granite
crude granite
tawdry sky
crude granite
crude granite
zealous grove
#

I'm not seeing the problem in your video

crude granite
# zealous grove I'm not seeing the problem in your video

That was the pitch axis rotation -80 only, my goal was to add a Yaw facing where the main part is facing.

The problem was, that if I changed both axes, It would rotate its pitch instead.
I have already experimented switching to a different axis and haven't figured out how to do it.

What I tried: -Fail

AlignOrientation.CFrame = CFrame.fromEulerAnglesXYZ(math.rad(-80), math.rad(-MainLand.Orientation.Y), 0)

-80 was the pitch (up and down) - looking down

Visual Representation:

#

I still couldn't quite get how the rotation of AlignOrientationworks.

#

The pitch orientation only:

crude granite
crude granite
zealous grove
#

Cframe.lookat(vector3.zero, -vector3.yaxis, part.cframe.lookvector)

#

Maybe your looking for this?

crude granite
crude granite
#

I disabled the PrimaryAxisOnly and AlignType for testing purposes.

Here's the code:

UpdateCFrame - onHeartbeat

AlignPosition.Position = Vector3.new(AlignPosition.Position.X, defaultZoom + accumulated_zoom, AlignPosition.Position.Z)

AlignOrientation.CFrame = CFrame.new(workspace.CurrentCamera.CFrame.Position) * CFrame.fromOrientation(math.rad(-90), 0, math.rad(-MainLand.Orientation.Y))

Camera.CFrame = camera_part.CFrame

setup

function setupCamera(Plot: Model)
    Camera.CameraType = Enum.CameraType.Scriptable

    local camera_part = Instance.new("Part", workspace)
    camera_part.Position = Plot:GetPivot().Position + Vector3.new(0, defaultZoom, 0)
    camera_part.Size = Vector3.one
    camera_part.Transparency = 0 -- Temporary
    camera_part.CanCollide = false
    camera_part.CastShadow = false
    camera_part.CanTouch = false
    camera_part.Name = "camera_part"

    local Attachment = Instance.new("Attachment",camera_part)

    local AlignPosition = Instance.new("AlignPosition",camera_part)
    local AlignOrientation = Instance.new("AlignOrientation",camera_part)

    AlignPosition.MaxForce = math.huge
    AlignPosition.Responsiveness = 25
    AlignPosition.Mode = Enum.PositionAlignmentMode.OneAttachment
    AlignPosition.Attachment0 = Attachment
    AlignPosition.Position = Plot:GetPivot().Position + Vector3.new(0, defaultZoom, 0)

    AlignOrientation.MaxTorque = math.huge
    AlignOrientation.Responsiveness = 25
    AlignOrientation.Mode = Enum.OrientationAlignmentMode.OneAttachment
    AlignOrientation.Attachment0 = Attachment
    
    return camera_part , AlignPosition , AlignOrientation
end
crude granite
crude granite
#

my brain probably stopped working yesterday... (non-stop working on the game lol)

#

AlignOrientation.CFrame = CFrame.lookAt(AlignPosition.Position, MainLand.Position)
i did not realized they're just the same method 🗿

crude granite
#

im really bad at CFame

crude granite
zealous grove
crude granite
zealous grove
crude granite
#

the arrow on mainland the orange cell was facing right

#

basically its lookvector

#

and i want the camera to be face like that

zealous grove
#

Your arrow should be pointing downward ⬇️ and it should be on the top face

#

If you want it upside down then you can use -lookvector

crude granite
zealous grove
#

Then do

Cframe.Lookat(targetcameraposition, part.position)

crude granite
crude granite
#

its a good bug ngl

zealous grove
#

The target position is not correct

crude granite
# zealous grove The target position is not correct

I do not know what you meant by target position

AlignPosition.Position = Vector3.new(AlignPosition.Position.X, defaultZoom + accumulated_zoom, AlignPosition.Position.Z)
AlignOrientation.CFrame =  CFrame.lookAt(AlignPosition.Position, MainLand.Position)
Camera.CFrame = camera_part.CFrame
crude granite
zealous grove
#
local offset = vector3.new(0, 20, 10)

local function ZoomToLand(land)
    local targetPosition = land.Position + offset
    AlignPosition.Position + targetPosition
    AlignOrientation.CFrame =  CFrame.lookAt(targetPosition, land.Position)
end

local function CameraRenderStep(delataTime)
    Camera.CFrame = camera_part.CFrame
end
crude granite
crude granite
# crude granite

supposed to be like this, no land locking , AlignOrientation seems wierd

zealous grove
crude granite
zealous grove
crude granite
#

bumped

crude granite
zealous grove
crude granite
zealous grove
#

Align.cframe = land.cframe.rotation * cframe.fromorientation(1.396263, 0, 0)

crude granite
#

it could rotate side ways, ill test real quick

crude granite
#

Inverse??

crude granite
zealous grove
crude granite
#

i just inverse it works

crude granite
crude granite
#

i though Orientation and Rotation are the same

zealous grove
#

Align.cframe = land.cframe.rotation * cframe.fromorientation(1.396263, 3.141593, 0)

crude granite
zealous grove
crude granite
zealous grove
#

But no I don't memories it

#

Do you memories degrees?

crude granite
zealous grove
#

Why did you pick 80 degrees over 1.5 rad?

crude granite
zealous grove
#

Well why not 81 degrees

crude granite
zealous grove
#

Well 1.4 rad = 80.21409 degrees

#

But you picked 80 because your thinking in degrees and not rad

zealous grove
#

If you think in rad you would of picked 1.4

crude granite
#

i thought rad and degree are the same or are they???

zealous grove
#

I say I was my glass to be filled by 10 CM

#

Someone else says I want my glass to be filled by 4 inches

#

10cm = 3.937008 inches
4 inches = 10.16cm

crude granite
#

that make sense, I learned matric conversion but not pi/degree and stuff or I just dont pay attention in class, probably this school year 👀

zealous grove
#

You say let's rotate by 80 degrees I say let's rotate by 1.4 rad

#

Your 80 degrees has no meaning

#

But it has meaning to you

crude granite
zealous grove
#

Rad and degrees both have meaning to me

#

So I'm happy with using 80.21409 degrees

#

But you don't like that you want it to be perfectly 80

crude granite
#

Mhmm, i see

#

this kinda messed up, but in grade 10, it was pandemic time which i learn nothing since home school. 💀

#

now, im g12 which will be first collage next year

#

im basically behind to this nessesary stuff🗿

crude granite