Forum rules - please read before posting.

UFPS integration problem

I'm using the latest version of UFPS and version 1.64.5 on AC. Currently I have the UFPS player prefab working and moving around, I can generally interact with things the way I did before I integrated UFPS. The problem I am having is with camera switches, as the AC main camera is at the origin of the world (0,0,0).

So, it wants to transition from the main camera position instead of from the UFPS camera position.  Do I have to manually align the main camera with the UFPS camera or is there a better option?

Comments

  • Place a "SimpleCamera" prefab type on your UFPS Player as a child beside the UFPS camera in the Hierarchy - so that it has the same position/rotation but is a separate camera.

    Then switch to that camera instantly before transitioning to the "actual" camera you want to transition smoothly to.
  • I'll try that.  Thank you Chris.
  • edited October 2018
    The problem I'm having is that "return to last game camera" switches don't seem to work right even with that method.  It seems to skip the action completely.  Do I have to somehow switch to this before the cutscene in question runs?

    Do I have to manually transition back to the this workaround simple camera you propose as well?

  • Here's something odd, the camera I created as per your suggestion, when the game is run the far clip plane distance is set to 100.  Can you think of anything in AC which would cause this? 

    In edit mode I have it set to something huge, like 5K, so it jumping down to 100 is odd.
  • edited October 2018
    Additionally, a Character: Face object action is failing to complete now that I have UFPS integrated and being used. It just sits there running, holding up the action list. That action effects the player.

    In Player.cs line 485 in my version, the following line throws a null reference exception:

    firstPersonCamera.SetPitch (-angle);

    FirstPersonCamera is null there.
  • The field isn't "return to last game camera", it's "return to last gameplay" - i.e. the camera that was last active during gameplay.  If you're setting the SimpleCamera at the start of a cutscene, then it won't be considered as a gameplay camera and you will have to switch back to it once the cutscene ends if you want a smooth transition.

    I can't think of any reason the far clip distance would change - and to 100 at that.  If you place another SimpleCamera in the scene, does it change at runtime or when you transition to it?  It may be UFPS that's affecting it.

    When using UFPS, the FirstPersonCamera is indeed null - FirstPersonCamera refers to AC's own camera system, which you're not relying on.  To have the UFPS camera face a particular point in the scene, you would need to manipulate the UFPS camera through custom script.
  • Thank you for the feedback Chris, I think that should help.

  • So I went back to look into why the Character: Face object action doesn't seem to get the camera to face perfectly at the target.

    https://imgur.com/a/UiDf7lf

    I can't quite follow how the normal character code works alongside the UFPS integration script to control tilt, but the tilt is the factor that doesn't finish if the horizontal angle distance of the facing operation is short.  It only ends up moving a small distance.
  • edited October 2018
    At the end of the Run() method in ActionCharFace() there was a bug where the action bailed early because it didn't wait for tilt to finish.

    Here's my fix - you can see the added tilting check to continue running until turn and tilt are complete: 

    https://pastebin.com/Ht0zCQ4W

    I deduced this as I assumed the integration script wasn't being allowed to finish updating the tilt, as it only takes control during cutscenes.  So making sure the action didn't finish too soon allowed it to complete. 
  • edited October 2018
    Actually I'd put the issue down more as the two axes (pitch and spin) not being in sync.  I think it'd be smoother if the two were to start and stop at the same time - I'll look into it.
  • I agree, and originally that was what I wanted to change, but in the end I needed something quick to fix the issue as it was unusable before.  That sounds like a great change.
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.