Forum rules - please read before posting.

Feature request: Stop Camera?

Hey,

I wondered if it would be possible to have an option under 'Camera' in an actionlist that would stop the camera from moving? I have a camera attached to my player and I want it to stop following the player when it's moving to a point. I thought instead of making a new camera every time I want to do this, switch it back and forth etc, there could just be an action to stop it (so essentially if it's attached to a character, the character walks off without the camera), do a few actions like usual (i.e. walk to point, but without a camera following it) and then resume camera later? So stop and resume camera basically.

I hope this makes sense, is it something that could be done or is it too complicated?

Thanks!

Comments

  • The concept of "stopping" a camera doesn't really mesh with the way the camera system's designed.  Each camera type (GameCamera, GameCamera2D etc) moves according to it's own rules.  This makes a "one size fits all" approach (i.e. an official "stop" Action) not too appropriate.

    A custom Action, however, could do what you need.

    What camera type are you referring to?  To halt a GameCamera moving in e.g. the X direction, you can - through script - dynamically check/uncheck the Lock? option to control it's movement in that direction:

    _Camera activeCamera = KickStarter.mainCamera.attachedCamera;
    GameCamera activeGameCamera = activeCamera as GameCamera;
    activeGameCamera.lockXLocAxis = true;
  • Hi Chris,
    Thank you for that,
    Is this right?
    https://imgur.com/a/APnVLqM
    When I use the action in the actionlist, everything just stops and nothing happens. But if I remove everything from isRunning and save it (so essentially without the code) it runs like normal and the character moves to it's point, so it must be something I did.
  • You can use sites such as pasteall.org to paste code snippets.

    If an Action occurs instantly (i.e. doesn't have to wait for anything), there's no need for the isRunning pattern.  The Run() method merely needs the code I gave above, followed by the "return 0f;" statement.

    Also be sure to set the ActionList's When running field to Run In Background.
  • edited August 2018
    Hi Chris,
    Thanks a lot! Sorry for all the trouble :)
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.