PlayMaker Help & Tips > iOS Help

Orthographic camera changing size smoothly[SOLVED]

<< < (2/2)

Slater:
Thank you, looking at it now. Why do you Set float value (default size - last size) in "Get the Size"? I can't find where you use this. Am I missing something? Is last size really needed?

Slater:
Having problems getting this to work in the way I want it to. In my scene I have a subtitles fsm. In the last state in that fsm I do a Get Property and save orthographic size in a global float variable called default size. I also activate a empty gameobject called zoom camera.

In game object zoom camera I have it first wait 1 sec in first state. Then when finished it moves over to state 2, "Zoom in" state. In Zoom in state I do a Float Interpolate, Linear, From Float: globals/default size, to float: globals/target size (which is set to 8 ortho size, within the float variable), time 1, store result: globals/current size, finish event: idle.

Underneath in same state I have Set property for camera orthographic size and globals/current size.

idle event leads to idle state.

What happens is that it actually zooms to the right orthosize, but it doesnt do it smooth, it just jumps into the state.

Obviously there is something I am missing here. Any suggestions?

jeanfabre:
Hi,

 last size is necessary if you jump whil jumping to prevent the zoom value to restart from the the default which would not be smooth.

 My example is of course for you to get inspired, you should apply the same technic I used in your own fsm or in a new fsm and call it from within your logic. you will need to modify your fsm's for this work and be smooth.

Send me a package of your game or just that behavior for me to have a look.

 bye,

 Jean

Slater:
Thanks Jean. Not sure how to wrap up a behavior, but I got it sorted now. I had missed that you needed to check the box on Set Property for Orthograpic size to Every Frame in order for it to work. Made sense to me as soon as I saw it and clicked it :)

jeanfabre:
Hi,

 ok, I am glad you got it working,

bye,

 Jean

Navigation

[0] Message Index

[*] Previous page

Go to full version