"Barrel-Roll" Effect on Camera

Hello DevForum members. :wave: I was wondering how I can make a Barrel Roll Effect by manipulating the camera.

I am making an awards ceremony for a certain group, and I want everything to be seen as if it has been broadcasted on television, kind of like the Bloxxy awards. One of the effects I wanted to use for the camera is for it to fully rotate and move, but in the end, remain its Focus to the main stage that was built for this occasion.

What solutions have you tried so far?

I have tried using CFrame.Angles and Tweening, both which deemed unsuccessful. If needed I will provide code.

The Effect I want to achieve is like so:

Thanks for helping in advance! :smile:

You should include you code regardless so others can see your progress so far, it makes it easier to help

1 Like

Define “unsuccessful”. We need to see if it was an issue with the camera or an issue with your implementation.

Note that the camera cannot point directly up or directly down very well, so you may need to skip that part and set roll to 180 degrees at the bottom of the loop.

1 Like

Abi could you provide a video/better diagram so it is clearer to understand the type of effect you’re going for?

If you want it to be a camera that “Orbits” the stage and then slowly rotates around it, you can set the camera’s CameraType to Enum.CameraType.Scriptable and then get the centre which in your case should be ~the stage.

Then, every frame ( bind this to render stepped so that the camera doesn’t jitter ), increment the rotation of the Centre using

Centre = Centre * CFrame.fromEulerAnglesXYZ(0,0,0)

Change the values inside the fromEulerAngles to whatever you need per frame. Keep in mind that frames are fast, so setting the values minimally will provide a much nicer effect.

Then, just set the camera’s CFrame to that of the centre, offsetted in the negative Z direction. This should work, but again I’m not sure because I can’t test right now. Play around with the axes if you want, but this should give a desired “Orbit” effect.

2 Likes

How can I achieve this while moving the camera, so it seems more dramatic? I have tried tweening the camera, but it just isn’t working as I want it to. I’m sure this is a fault in my code.

I am not able to provide code at the moment, but I will once I get the chance.

Explain?

I want to tween the camera to certain positions while the rotation is occuring. Is there any way I can do this?

So you want the camera to like move up and down while it is spinning?

Yeah.

Then simply change an axis in the rotation per frame.

So when you rotate the camera, you’re changing one axis out of X,Y, and Z, but I can’t remember which applies to horizontal rotation.

If you change one of the other axes as well while the rotation axis is constant, by maybe rotating the Centre by the sin of tick(), you can create the effect that the camera is moving up and down slowly while rotating sideways.

I used Heartbeat instead of Renderstepped as I have different intentions for this, and your idea worked out. I manipulated the first value of fromEulerAngles to make the effect I wanted. Thank you!!