#I cant figure out CFrames or something is wrong because camera refuses to align rotation to part's.

1 messages · Page 1 of 1 (latest)

cyan kettle
#

The decal is set to front. And when I set cam CFrame to this parts CFrame I look genuenly the other way. And when I rotate the part 180 degrees I look in the wrong direction again... WHY?
Great... Now its even worse than before...
workspace.Camera.CFrame = workspace.CAM_Position.CFrame

#

1, The camera in an outside view
2. The camera after I set its CFrame to the part's.

covert grail
#

direction indicator or something like that

cyan kettle
#

And if I run This command rn.

covert grail
#

interesting

cyan kettle
#

I look here.

covert grail
#

you need to set the current camera and not workspace.camera

#

it's workspace.CurrentCamera

#

and also set camera type to scriptable

#

before the cframe

cyan kettle
#

NICEE. Setting it to scriptable made it look in the right direction but now I cant change its direction. But its alr cuz I could see how it looks. Tysm.

covert grail
#

no problem

#

also wdym can't change direction

cyan kettle
#

U carried ts 2 times in a row. Ty for helping out gang.

#

🙏

covert grail
#

you want it to turn the camera if you hold right click?

cyan kettle
covert grail
#

i see

cyan kettle
#

Are you still avaiable?

covert grail
cyan kettle
# covert grail yeah what's up

CFrame strikes again. I wanna as for some coding help if its fine. Since I swear to god CFrames are for some reason make me suicidal.

covert grail
#

sure

cyan kettle
# covert grail sure

So basically I have this.

        update = function( prop, dt )
            local counter = prop.Counter
            local rotValue = prop.Rotation
            local startY = prop.StartY.Value

            counter.Value += ( 60 * dt ) % 360

            local newY = startY + (math.sin(math.rad(counter.Value)) * 7)
            local nextPos = Vector3.new(prop.Position.X, newY, prop.Position.Z)

            local rotationStep = CFrame.Angles(
                rotValue.X * dt, 
                rotValue.Y * dt, 
                rotValue.Z * dt
            )

            prop.CFrame = CFrame.new(nextPos) * prop.CFrame.Rotation * rotationStep
        end
#

And I wanted it to rotate in the same continous direction as a constant and levitate. Now, the levitation part works fine... But the rotation one.

#

This is NOT how I'd like for it to behave.

#

Wrong video.

#

Mb.

cyan kettle
# covert grail sure

Tho this might be too much. Since I have 0 idea wtf is with CFrames and their rotations.

covert grail
#

have you tried

prop.CFrame *= CFrame.angles(0, math.rad(1), 0)
#

just that for the rotation

cyan kettle
covert grail
#

so it's fixed right

cyan kettle
#

AH

#

I get the problem.

#

My absolute DUMBASS

#

Named the rotation object... The same as the props rotation property.

#

Take a deep breath.

#

Damn.

#

Now that I knew the issue I could fix it.

covert grail
#

i'm glad

cyan kettle
#

You pointed out the obvius I needed.

#

Your such a goat.

covert grail
#

no problem

cyan kettle
#

Its the wrong video again

covert grail
#

if you need any more help dm and i'll respond when i can

cyan kettle
#

Just to show you the fruit of your help.