|
Post by craigdennis on Apr 22, 2022 10:55:59 GMT
When heading into a new scene, if the player (target) begins within a trigger boundary or room you see the camera moving towards the target like you would expect from it's original location eg (0,0,0), as shown below in the video: at the beginning of the second scene the camera moves from the bottom right towards the fixed boundary:
Is there a method I can run that will snap the camera to the final position (eg. skipping the transition) when a new scene is first loading?
I noticed there is a method like this:
Which says in it's description "Instantly moves the camera to the targets' position.". I am running this about a 200ms after a frame has loaded hoping to snap before the scene has started fading in but guarantee all the objects are positioned in their correct place but this doesn't seem to change anything in this situation.
Do you have any idea's how I could achieve this?
|
|
|
Post by craigdennis on May 15, 2022 8:59:53 GMT
A small note that looking back at the video the transition looks very minor, but sometimes on other scenes the player starts at a much further away target than the camera default position so is much more noticeable.
It's been a while since I posted so I'm just checking, if there is no solution for this built into ProCamera2D (to skip a transition and snap to the target) I can just hack one in myself quite easily. Just would prefer to use one that exists if there is one, but can't find any in the documentation. (Note that the "Transition instantly on start" and the "ProCamera2D.Instance.MoveCameraInstantlyToPosition()" method isn't working for me either)
|
|
|
Post by craigdennis on May 15, 2022 11:20:24 GMT
I should also mention I already have tried switching "Transition on Start" on/off on the room but this doesn't seem to change anything. At the moment, I have just hacked this in (I know it's horrible) within the TestRoom() method that just checks if the time since the level loaded is less than 0.1f it sets useTransition to false. It's horrible but it works for now until I find a more elegant solution.
|
|