Jump to content


Photo

how to make "Breathing view"


  • Please log in to reply
6 replies to this topic

#1 Toke_dk

Toke_dk

    GMC Member

  • GMC Member
  • 35 posts
  • Version:GM:Studio

Posted 05 July 2012 - 06:01 PM

hey All.

I was looking into how to make a breating view, but is stuck at shake...

Can anyone helps me on this? I want the view to move slowly up and down.

Kind Regards

Toke
  • 0

#2 PoniesForPeace

PoniesForPeace

    puzzling

  • GMC Member
  • 493 posts
  • Version:GM:Studio

Posted 05 July 2012 - 06:02 PM

sine()
  • -2

#3 Toke_dk

Toke_dk

    GMC Member

  • GMC Member
  • 35 posts
  • Version:GM:Studio

Posted 05 July 2012 - 06:13 PM

sine()



Can you please elaburate. I looked at sin/cos object, but couldn't find anything on view.

Kind regards
Toke
  • 0

#4 psycho666

psycho666

    GMC Member

  • GMC Member
  • 831 posts
  • Version:GM8

Posted 05 July 2012 - 06:14 PM

sine()

Sorry, don't get me wrong but WHAT? Even i as fairly familiar with GML don't have a clue about what this is...
Can your post have a bit less info?
  • 0

#5 PoniesForPeace

PoniesForPeace

    puzzling

  • GMC Member
  • 493 posts
  • Version:GM:Studio

Posted 05 July 2012 - 07:09 PM


sine()



Can you please elaburate. I looked at sin/cos object, but couldn't find anything on view.

Kind regards
Toke


lol

i meant sin()
  • 0

#6 Southman

Southman

    I simply am not here

  • GMC Member
  • 1662 posts
  • Version:GM:Studio

Posted 05 July 2012 - 07:19 PM

In a new object, add this to the create event:
global.breathing=1

breathing_speed=5
breathing_offset=10
_s=0

In the step event, add this:

if global.breathing=1{
view_yview[0]=0+sin(_s)*breathing_offset
_s+=breathing_speed/20
_s=_s mod 360
}else{
view_yview[0]=0
}


You can modify the breathing_speed, and the breathing_offset to fit your needs

Edited by Southman, 05 July 2012 - 07:20 PM.

  • 0

#7 Toke_dk

Toke_dk

    GMC Member

  • GMC Member
  • 35 posts
  • Version:GM:Studio

Posted 06 July 2012 - 12:33 PM

In a new object, add this to the create event:

global.breathing=1

breathing_speed=5
breathing_offset=10
_s=0

In the step event, add this:

if global.breathing=1{


view_yview[0]=0+sin(_s)*breathing_offset
_s+=breathing_speed/20
_s=_s mod 360
}else{
view_yview[0]=0
}


You can modify the breathing_speed, and the breathing_offset to fit your needs


That worked perfect, thank you!

Edited by Toke_dk, 06 July 2012 - 12:35 PM.

  • 1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users