Hello, guys. I’m making autogeneration for trees. But, as usual, I got some problems, for now with CFrames. I need to tilt them down (orientation only). I already can tilt them down, but it’s possible them to tilt up after some time.
So, I need get value, which will represent, how much CFrame direction is looking down, to prevent tilting up.
Can anyone give me some ideas, how to implement this down-look check?
im not sure if i understand exactly what youre looking for but to get a measure of how much a cframe is ‘looking down’ you can use the look vector of the cframe and dot product it with the negative y axis (0,-1,0). To be precise this will give the cosine of the angle measured between the look vector and the -y axis. to get the angle you would just use acos
local cosine = cf.lookVector:Dot(-Vector3.yAxis)
local angle = math.acos(cosine)