Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to scale character by y coords of edge collider?

Discussion in '2D' started by delphifissure, Apr 23, 2017.

  1. delphifissure

    delphifissure

    Joined:
    Apr 20, 2017
    Posts:
    6
    I'm making a 2d sprite-based game that will seamlessly switch (hopefully) from standard platforming to Monkey Island style exploration.

    I intend to use a box trigger at the entrance of exploration segments to make the player start scaling along with the Y coord of the edge collider they're on / above.

    They still need to be able to jump, so to prevent shrinking in the air they should be scaling according to the y coord of the edge collider they're on vs. the character y coord.

    It sounds like it should be pretty simple but I'm just getting started at C#. Does anyone know a way to handle this? Presumably with transform.localscale?