playMaker

Author Topic: How do I make this in Playmaker?  (Read 3415 times)

Budde88

  • Full Member
  • ***
  • Posts: 165
How do I make this in Playmaker?
« on: July 24, 2015, 06:41:47 AM »
The code below is supposed to zoom the Camera in and out according to the Characters height.

Can anyone help me out?

var : relativeHeight = (transform.position.y - minHeight) / (maxHeight-minHeight);
 camera.orthographicSize = Mathf.Lerp( minSize, maxSize, relativeHeight );

Thanks

Budde88

  • Full Member
  • ***
  • Posts: 165
Re: How do I make this in Playmaker?
« Reply #1 on: July 24, 2015, 03:44:14 PM »
Wow, 19 views and no reply haha

Anyone out there that can help me?

DarkSoul

  • Playmaker Newbie
  • *
  • Posts: 37
Re: How do I make this in Playmaker?
« Reply #2 on: July 26, 2015, 12:23:18 PM »
Hello,

You can use get position and assign it to float , then make the subtraction using float sub action
Then using float multiple ,
As for the camera you can use set property and set minsize , maxsize , and relativeHeight individually.

I hope this helps.

Budde88

  • Full Member
  • ***
  • Posts: 165
Re: How do I make this in Playmaker?
« Reply #3 on: July 27, 2015, 07:35:41 AM »
Hey Dark Soul,

Thanks for the reply. I believe the min height and max height are the orthographics camera size variables. Not exactly sure how to access those.


As for the camera you can use set property and set minsize , maxsize , and relativeHeight individually.


This was a little bit vague for me. Set Property of minsize and max size for what exactly? I tried to implement it but I could not. Maybe you could post a picture for me. Can All of this be included into 1 FSM?

Budde88

  • Full Member
  • ***
  • Posts: 165
Re: How do I make this in Playmaker?
« Reply #4 on: July 27, 2015, 07:49:39 AM »
Ok :)

I got it working. Thank you very much for helping me out!