Speedometer Needle Interpolation
I've got my speedometer needle on my dashboard that rotates around when the truck moves. All good except when you Release a button (stopping the truck) the needle continues to rotate clockwise instead of counter.
Needle's rotation is 0 and is pointing to the bottom left of the circle.
when speed=1
Interpolate self.rotation to -152
when speed=0
interpolate self.rotation to 15
I've tried many different numbers...what am I missing here?
Needle's rotation is 0 and is pointing to the bottom left of the circle.
when speed=1
Interpolate self.rotation to -152
when speed=0
interpolate self.rotation to 15
I've tried many different numbers...what am I missing here?
Comments
I wish when you were interpolating rotation you had an option for clockwise or counter like you get with the standard rotate behaviour.
However, the second half of the needle would be off the scene or transparent, so it would look like it's rotate around the end.
Also, then you could say when self. rotation is more than x, constrain it to x.
And when it's less than y constrain it to y
So that way it couldn't rotate a full 360 degrees
here's teh file: http://www.funkymunkygames.com/Promo/needle_lever.gameproj.zip
Then I suggest you have a rule that says:
When self.speed = 1
-- Interpolate Attribute: self.Rotation To: 15
otherwise
-- Interpolate Attribute: self.Rotation To: 208
That should give you the results you want.
RThurman
Thanks a lot though guys, @ RThurman I tried your method first and it worked.
Cheers!
RThurman
@TouchTiltGames ... the project file I posted could be made into a cool RPM gauge and throttle?!?!? Kids (adults too) might love to rev up the engine and make some noise!
Anyway love the look of your App so far well done.
RThurman