#AlignOrientation in 2 Axis. HELP
1 messages · Page 1 of 1 (latest)
#1143220803287130224 message
I will try, thanks for the help 
Quick update, same issue
AlignOrientation.CFrame = CFrame.fromEulerAnglesXYZ(math.rad(-80), math.rad(-MainLand.Orientation.Y), 0)
I will be experimenting further
EDIT: Still havent fixed
Wait are the top left and top right buttons official or you made them?
Its built-in roblox beta feature
So what did was set the Attachment Orientation instead on second axis since i have no other choices left.
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:
The arrow is supposed to be facing down | Camera
also, rotating the orientation did not help... In attachment
Cframe.lookat(vector3.zero, -vector3.yaxis, part.cframe.lookvector)
Maybe your looking for this?
the camera should be facing the arrow
I tried using this method:
CFrame.new(workspace.CurrentCamera.CFrame.Position) * CFrame.fromOrientation(math.rad(-90), 0, math.rad(-90))
However, if I change the radian to -80 on up and down / pitch it will roll instead of up and down. I already tried switching into different axis and still failed.
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
I hope you understand what i meant
Funny thing, i just realized i did the same thing on this video:
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 🗿
quick question though, its facing -90, im haivng trouble making it -80 or less
im really bad at CFame
sorry for being annoying lol but I am stuck on this progress right now.
I don't really understand what your trying to do
Just rotate the camera up and down -80 degree's and rotate left and right orientation as the main part. the one with arrow.
This does not make any sense to me
the arrow on mainland the orange cell was facing right
basically its lookvector
and i want the camera to be face like that
The code I sent you above is correct but your arrow is pointing the incorrect direction
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
The camera and arrow is all good as shown here #1146033878000205926 message
but, i want it not exactly to be -90 degree looking on the ground, but -80 or less like form the video #1146033878000205926 message
Then do
Cframe.Lookat(targetcameraposition, part.position)
For some reason, it looks like which i did not expect but looks amazing.
but ofc, if i select a available cell, the orientation is not correct since i havent implemented it on other stuff
its a good bug ngl
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
my goal was not to make to object it lock but rotate -80 degree.
I am so sorry, I may be very annoying XD
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
i will be trying this thanks
supposed to be like this, no land locking , AlignOrientation seems wierd
Align.cframe = cframe.fromorientation(1.396263, 0, 0)
how do you get that value
math.rad(80) = 1.396
so that just goes back to the original video?
bumped
it works but the camera should be rotate to align with arrow
The arrow is not correct
it meant to be like that since ill be placing these with different orientation on the map in the future
Align.cframe = land.cframe.rotation * cframe.fromorientation(1.396263, 0, 0)
hmm, sounds similar but ill try
it could rotate side ways, ill test real quick
YOOO THANK YOU SO MUCH!
is there a way to reverse it?
Inverse??
Inverse works
I don't understand
Thank you so much by the way, iI am so sorry for confusion
MainLand.CFrame.Rotation:Inverse() * CFrame.fromOrientation(math.rad(-80), 0 , 0)
i though Orientation and Rotation are the same
Align.cframe = land.cframe.rotation * cframe.fromorientation(1.396263, 3.141593, 0)
just quick question, do you memorize it?
Memories what?
radian
Pi = 180 degrees
But no I don't memories it
Do you memories degrees?
probably no not everything, im just confused since you used 1.396... instead of math.rad
Why did you pick 80 degrees over 1.5 rad?
probably just a preference, it looks good on that angle
Well why not 81 degrees
its close to 90, i just floored the value cuz idk
Well 1.4 rad = 80.21409 degrees
But you picked 80 because your thinking in degrees and not rad
ohhhh
If you think in rad you would of picked 1.4
i thought rad and degree are the same or are they???
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
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 👀
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
yeah
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
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🗿
anyways, thank you so much for the help, This knowledge will be applied for future scenario's. you can close this post now 