Captain Cody Posted March 25, 2016 Share Posted March 25, 2016 Is there any way to slowly move a camera using set camera matrix, or some similar function. Trying to make a camera slowly move around the map behind login screen, but cannot figure out how I'd do this without having to define a hundred points in a table that it slowly loops about. Link to comment
..:D&G:.. Posted March 25, 2016 Share Posted March 25, 2016 Here, use this: local frame = 0 local goingRight = true local goingLeft = false function rotateCamera( ) if frame <= 400 and goingRight then local a, b, c, d, e, f = getCameraMatrix() setCameraMatrix(a, b, c, d + 0.2, e + 0.2, f) elseif frame <= 200 and goingLeft then local a, b, c, d, e, f = getCameraMatrix() setCameraMatrix(a, b, c, d - 0.2, e - 0.2, f) end frame = frame + 1 if frame == 400 and goingRight then goingRight = false goingLeft = true frame = -400 elseif frame == 200 and goingLeft then goingRight = true goingLeft = false frame = -200 end end And add this in the function where you render your login panel: addEventHandler("onClientRender", getRootElement(), rotateCamera) Don't forget to use removeEventHandler when you remove your login panel. Link to comment
Captain Cody Posted March 25, 2016 Author Share Posted March 25, 2016 Well something like that was what I was originally going to do, was just wondering if there was any other ways. Guess I'll go with something such as that. Link to comment
Captain Cody Posted March 25, 2016 Author Share Posted March 25, 2016 I think I'll just have it trace an object, and have the object move to the destination using moveObject. But set the objects alpha to 0 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now