0 votes

Hi,

is there a way to autoscale the character when he is near of the foreground in a 2D game?

For example, imagine the next scene in a 2D point and click game:

enter image description here

Character should appear bigger in the foreground than when he walks by the end of the scene. Can I control this without use code? Can I select the zones when the character should escalate progressively.

Thanks and kind regards.

in Engine by (15 points)
recategorized by

1 Answer

+2 votes
Best answer

Here is a very rough idea of how to do it. I'm sure there are better ways, but you could maybe try starting with this: https://github.com/e-e/godot-y-scale

The main idea is that you set points where you know what the scale should be, and it will try to figure out the inbetweens based on the distance between two known points, using the players y-position.

by (1,650 points)
selected by

Thanks Eric! I will try it and I will comment the results. :)

Thanks Eric! It works very well. I tried with polygons to select the area where the character should scale, but your approach is better.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.