Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

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 8

    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!

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.