playMaker

Author Topic: Matching a Range on a float to rotate axis?  (Read 1544 times)

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Matching a Range on a float to rotate axis?
« on: January 20, 2014, 04:53:00 PM »
Hi guys, lets say I have a variable in a script called amount:

[Range(100,20000)]
public float
amount = 100;

I've set a range for this float from 100 to 20000.

What I want to do is rotate an object (like a volume dial on a HiFi) so when the object is at 20 degrees it tells the script's amount variable to be at 10 and when the object is rotated to 340 degrees its at the top of the range at 20000.

I have no idea how to set this up in Playmaker  :o

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Matching a Range on a float to rotate axis?
« Reply #1 on: February 03, 2014, 03:46:30 AM »
Hi,

 you should use this action ( float remap or cross multiplication)

http://hutonggames.com/playmakerforum/index.php?topic=5122.msg24311#msg24311

If you are having trouble with this let me know.

Bye,

 Jean