Reverse Magnitude Function

I created 2 attributes called finger x,finger y and constrain them to self.position.x and self.position.y (finger). I created an actor and I created a magnitude function in a constrain attribute >> magnitude(finger.x-self.position.x,finger.y-self.position.y) so it records the distance between actor and the finger actor. If the finger actor goes far the actor grows, if the finger comes the actor dwindles. So, How can I make actor grow when finger comes closer and make actor dwindle when the finger goes far. ?

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    It would be something like:
    (sceneWidth/2) - magnitude

  • SocksSocks London, UK.Member Posts: 12,822

    @RThurman said:
    It would be something like:
    (sceneWidth/2) - magnitude

    Yeah, I'd do it like this too, just start with a base value and subtract the magnitude, also min and max might be useful here to limit the largest and smallest sizes the actor is allowed to shrink/grow to.

  • SocksSocks London, UK.Member Posts: 12,822

    Attached is a quick demo file:

  • thank you guys

Sign In or Register to comment.