Forum rules - please read before posting.

Action: Camera Switch - MainCamera script not resetting 'attachedCamera' variable after transition

edited November 2019 in Technical Q&A

Hi,

I've setup my scene with Opsive UCC beforehand and converted the Main camera and I was getting an issue when using the Camera Switch action to transition between two cameras.

The 'attachedCamera' variable on the MainCamera script was not being set back to null after the switch and so would keep calling ApplyCameraData from LateUpdate, rendering my camera completely static.

I've since remedied this by setting 'attachedCamera' to null in the ResetMoving function. Was this an issue with my scene setup? I have no default camera set at the moment.

Comments

  • attachedCamera should remain set to the new camera upon switching - it shouldn't be set to null.

    This should also be the case when the scene begins - you should always have a default camera set, since the MainCamera is merely used for rendering, while "GameCameras" are used for the actual camera positioning.

    This may be a conflict related to Opsive UCC - are you using any camera script / object used by UCC? If you're using UCC for the main rendering, try instead converting it into a custom camera type by attaching the "Basic Camera" component and using it as you would any other AC GameCamera, with the AC MainCamera being used for all rendering. See the Manual's "Custom cameras" chaper for more on this.

  • edited November 2019

    Ok thanks for the help, I've attempted to use the default AC setup as you've mentioned but I get a lot of jankyness which isn't there when controlling the AC MainCamera with UCC. I imagine that would be because of two layers of Camera positioning instead of just the one.

    Will I run into any further issues with the work-around I am using at the moment? What would you suggest?

    Edit: My mistake! I had to change some things around with the scene setup to get the Camera Switch working and didn't realise my UCC camera wasn't being uparented from the player via the actionlist which was giving it the jankyness. I'm moving the character right up until I give the player control so I've had to make sure the position is correct by parenting the new game camera to the character. Seems to be working now 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.