Forum rules - please read before posting.

Slightly camera shaking

Hi, I know the question is off topic, but I couldn't find anything in google, I want my camera to be slightly shaking during game like in The Uncertain. Does anybody know how can I do that without code?

Comments

  • Cinemachine can cameras provide such shaking.

  • edited October 2021

    There are three ways without code.

    1) There is a camera shake action you can use in an actionlist but this more geared torwards sudden and one shot shakes.

    2) Parent the camera to a empty game object (call it something like Camera Arm), put an animator on the empty game object and animate a looping bit of movement.

    3) As Chris says use Cinemachine (though I've never given it a go but I've heard good things about it)

  • Thank you so much guys!

  • @ChrisIceBox thanks for the answer, I've installed cinemachine to unity, but I can't find out how to do the slightly camera shaking, maybe you know about some video tutorial for it or article?

  • The shake you're referring to is called "noise" in Cinemachine - an official tutorial on it can be found here.

  • @ChrisIceBox thank you so much for the answer, I'm sorry again for off topic question, but unfortunately I can't get it to work, I'm adding CinemachineBrain and CinemachineVirtualCamera components to the Navcam1 Inspector watching your 3d game long tutorial, I was playing with the cinemachine noise options for about an hour, but all I get is some armageddon, really strange camera shaking, even hitting, you can watch it by this link https://staging.streamable.com/mgi5px

    I read the possible solution, It was to change the update option for camera and set rigidbody interpolate option to interpolate, I've draged the prefab of EL_TinPot to hierarchy, then in it's inspector added rigidbody and set it's interpolate to interpolate, also changed the update option for the camera, nothing helps, here are the screens of my settings

    Thanks again for wasting your golden time on my stupid problems.

  • If you're using Cinemachine, you'll need to use it fully - you can't add it to AC's existing camera system simply to add shaking, you'll need to rely on it completely, i.e. for positioning, rotation, etc.

    Much like the way AC uses its MainCamera for rendering, and GameCameras for reference, Cinemachine has its CinemachineBrain and VirtualCamera objects. These need to be separate - you can't place everything on the same object.

    If you're new to Cinemachine, you should study its usage in a fresh project without AC first.

    To incorporate into your AC project, it's then a case of attaching AC's "Basic camera" component to your Cinemachine Brain, so that AC's MainCamera can treat it like a regular GameCamera.

    If all you're ultimately trying to do is simply add some camera shake, it's best to go with Temmy's second suggestion of moving the GameCamera's Camera component to a child object, and animating the child instead.

  • Thanks a lot for your reply, this forum is the only way I can get answers to my numerous questions. I have a question about why do I need to create an empty object child for the parent GameCamera object? Beacause I did the animation to GameCamera itself without creating a child object for it and it worked.

  • To avoid conflict between both your animation and a GameCamera both trying to control rotation (depending on its settings), it's better practice to place them on separate objects.

  • To avoid conflict between both your animation and a GameCamera both trying to control rotation (depending on its settings), it's better practice to place them on separate objects.

    Precisely this. You might reach a point that you want your camera to rotate at something, or react to input...etc and if you're trying to control the same object which is animating suddenly everything messes up. The easy and best thing to do is to seperate things out to minimise potential conflicts.

  • Thank you!

  • Hi there, in 3D Game tutorial I try to make the camera to react on the player X, which is set to NavCam 1 GameCamera script and make the slightly camera shake togheter, but I can't control the Camera to react the player movement and the slightly shaking movement together, I've created the child empty object for Navcam 1, and transfered to that child object the animator component from Navcam 1, didn't work, then I've also transfered the Camera component from navcam 1 to it's child empty object, again I can't control the camera react to player movement and camera slightly shaking together. I think I'm missing something or doing something wrong, but I don't know what. Will be much appreciated if someone can help me with this.

    Thanks Beforehand.

  • An Animator can only affect objects that are beside it, or below it, in the Hierarchy - the Camera and Animator components will both need to be children of the GameCamera.

    Check that your Animator is set up correctly by disabling the GameCamera component and see if it's updating the camera correctly just by itself. Once so, re-enable the GameCamera - if you have issues then, share screenshots.

  • I had a huge headache to figure out how it should work properly, but it worked! Thank you so much! You are such a genious!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.