Move the camera so its as if its breathing....is there a tidy way to do it?
StormyStudio
United KingdomMember Posts: 3,989
Evening
Ok, next challenge, move the camera control so it is as if there is a breathing motion. say 25 pixels up over 3 seconds, then 25 down over 2 seconds.
I know I can do it with a couple of attributes, on, then move up, off, then move down. repeat with timers.
But I wondered if there was a more efficient way to do with the likes of sin() cos() etc....
Ok, next challenge, move the camera control so it is as if there is a breathing motion. say 25 pixels up over 3 seconds, then 25 down over 2 seconds.
I know I can do it with a couple of attributes, on, then move up, off, then move down. repeat with timers.
But I wondered if there was a more efficient way to do with the likes of sin() cos() etc....
Comments
Just found the way I wanted...
adapted a bit of maths from an old post of 'Orbs'
add a 'move' behavior to my camera control (actor which controls camera move)
Then chose the direction for the move, and then in speed put
sin(game.Time*100)*100
and played around with the numbers till it was what I was after
sin(game.Time*60)*15
nice smooth breathing motion, moving up and down and easing in and out at each end, all in one line of code...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps