Author Topic: Mathf clamp and moveTowards  (Read 3659 times)


  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Mathf clamp and moveTowards
« on: April 09, 2014, 09:53:05 AM »
float scl = Mathf.Clamp01((spd - minZoomSpeed) / (maxZoomSpeed - minZoomSpeed));

A clamp that has an operator in it? I don't even know how this works.

cam.ZoomFactor = Mathf.MoveTowards(cam.ZoomFactor, targetZoomFactor, 0.2f * Time.deltaTime);

This one I can probably figure out how to create but in case someone already created a move towards based on floats?
All my VR games use Steam VR Playmaker Toolkit:
And Oculus Touch Playmaker Toolkit:

Follow me @sebasRez