playMaker

Author Topic: Tweening Camera FOV problems [solved]  (Read 6215 times)

jess84

  • Hero Member
  • *****
  • Posts: 515
Tweening Camera FOV problems [solved]
« on: July 14, 2014, 06:38:38 PM »
So I've got my Camera's FOV at 73, and I want to tween it over a couple of seconds to FOV 61.

I'm using HOTween to tween a float between those two values, and on the same state I'm using a Set Property (every frame) to update the FOV.

It works, however when doing this for the first time after loading the scene, for 1 frame the FOV is set to 0 and I get an error

Code: [Select]
(Screen position out of view frustum (screen pos 152.000000, 330.000000) (Camera rect 0 0 816 459)
UnityEngine.SendMouseEvents:DoSendMouseEvents(Int32, Int32)

I've tried the different options, like Update/Late Update/Fixed Update, but it always sets it to 0 before the values I actually want!

I've checked before pressing my button, and the FOV target/start floats are correct. It just goes 0-73....tweening to 61.

If I then zoom back out (similar action, just with the Start/End values switched), and then zoom in again - there's no 0 used. And it works perfectly.

I've been fiddling with this for the last hour and it's driving me insane!

Any ideas?

« Last Edit: July 16, 2014, 10:51:31 AM by jess84 »

mikejkelley

  • Full Member
  • ***
  • Posts: 136
Re: Tweening Camera POV problems
« Reply #1 on: July 15, 2014, 04:39:19 AM »
Not familiar w/ the POV parameter. Perhaps FOV?

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Tweening Camera POV problems
« Reply #2 on: July 15, 2014, 05:16:49 AM »
Oops,  yes

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Tweening Camera POV problems
« Reply #3 on: July 15, 2014, 07:26:57 AM »
Pretty strange that it doesn't do it going backwards, might be a glitch in the first time unity runs it, or something to do with postfx. Is it an Error or a Warning?

Have you thought about just changing it at the start of the scene, first thing, then going about business as usual?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Tweening Camera POV problems
« Reply #4 on: July 15, 2014, 11:19:23 AM »
It's an error, not a warning. (and you can visibly see the camera jump through the scenery to FOV 0).

I really don't know the solution here, and if I forced it at the start of the level, I'm still going to get those errors (spamming the analytics), and looking ugly. And it's not like I could disable the camera component, as I'll have an ugly blank transition.

But yeah, as I said, it only does this on first attempt after loading the scene. After it's happened, I can zoom in/out repeatedly with the FOV settings being within the correct 61-73 range every time. And most irritating is that I can see my float is 73 way before I actually attempt to zoom.

Maybe it's a problem with HOTween? I guess I'll just try Float Interpolate to see if it still occurs...

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Tweening Camera FOV problems
« Reply #5 on: July 15, 2014, 03:55:39 PM »
OK - It's a problem with HOTween - or the HOTween actions. (I have no idea which, or the ability to look into it further!)

I tested it with Float Interpolate, and it wasn't a problem

Which isn't great, as I'm now limited to just Linear or Ease In Out for this motion. :(
« Last Edit: July 15, 2014, 05:10:45 PM by jess84 »

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Tweening Camera FOV problems
« Reply #6 on: July 15, 2014, 05:59:36 PM »
The HOTween guy says that this isn't a problem with the HOTween engine. Which leaves.... The PlayMaker actions.

Any idea who wrote them? Could they please have a look to see if they can identify the problem?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Tweening Camera FOV problems
« Reply #7 on: July 16, 2014, 01:12:41 AM »
Hi,

 I wrote them, I'll have a look, but it seems odd indeed, and likely unrelated to the action itself, Are you positive nothing else comes into play to control this FOV? Can you bump me next week if you haven't heard back? thanks :)

 Bye,

 Jean

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Tweening Camera FOV problems
« Reply #8 on: July 16, 2014, 08:22:35 AM »
I'm absolutely positive.

I've tested with HOTween Float and Interpolate Float actions that do exactly the same thing (start and end positions, time, linear) in my state -  unchecking one, testing. Then stopping my game, changing to the other method, and retesting.

It happens on first running my scene every time with the HOTween action, and never with Float Interpolate.

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Tweening Camera FOV problems
« Reply #9 on: July 16, 2014, 09:06:58 AM »
Also note what I said above about the same problem happening with HOTween Vector 3 to scale an object. It disappears briefly because the scale is set to 0 for a frame initially.  (again, doesn't happen with Vector3 Interpolate)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Tweening Camera FOV problems
« Reply #10 on: July 16, 2014, 09:08:44 AM »
Hi,

 Found the bug, I did not set the result value to the starting value when initialising.

 Can you redownload the package from the thread and see if it solve the issues?

 Bye,

 Jean

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Tweening Camera FOV problems
« Reply #11 on: July 16, 2014, 09:10:50 AM »
Great, thanks!

From which thread?

And is this a fix which will cover all of the HOTween actions?

Thanks again!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Tweening Camera FOV problems
« Reply #12 on: July 16, 2014, 09:16:17 AM »
Hi,

 from the hotween thread itself:

http://hutonggames.com/playmakerforum/index.php?topic=2299.msg10104#msg10104

Yes, I have made the fix for all possible variables in that action.

 Bye,

 Jean

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Tweening Camera FOV problems
« Reply #13 on: July 16, 2014, 10:51:05 AM »
Just tested, and is fixed.

Thanks again.