How do I change a shadow's opacity in relation to another object?

0 favourites
  • 2 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Well, I already know how to do the first bit. I've got a shadow and it measures the distance to its owner and sets opacity according to that value. The bit I'm getting stuck on is that it's working in the reverse as to how I want it to happen. Basically, the closer the object, the darker the shadow should be, not vice versa. Added a gif to demonstrate.

    And here's the code:

    I feel like I need an expression that can take a number and flip it within a range of 100. So 3 becomes 97, 30 becomes 70 and so forth. But I don't know how to do that or if it's even feasible.

    TIA

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • lol, I'm such a dork. The answer was in my question.

    Just added a second variable which is the difference between 100 and distanceToOwner and set opactiy to that. Sure enough, it works.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)