Search Unity

Rotating character while walking shrinks it (2d, bolt)

Discussion in 'Visual Scripting' started by Giovy79, Apr 17, 2021.

  1. Giovy79

    Giovy79

    Joined:
    Apr 16, 2021
    Posts:
    4
    Hi,
    I'm using Bolt to make my player character moving when pressing arrow keys.
    When i make the script to rotate the character at left and right, and play, it works. But the character is too shrinked. If i delete the piece, it works fine.
    How i do this without shrinking my player character?
    Here is the script:

    Script: https://ibb.co/RBK01GY
    Game with script disabled: https://ibb.co/c18Vrwm
    Game with script enabled: https://ibb.co/HpccgBb
     
  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,063
    1. You're not rotating your character, you're setting its scale. Setting the scale to -1 on the x axis is what flips it. In the graph you set the scale to (-)1,1,1 which overrides the scale you've manually set on the GameObject in Hierarchy.
    2. If you want your character to be larger in the scene, don't edit its scale in hierarchy manually, instead in Sprite import settings, change the PPI number and leave scale at the default 1.
    3. Alternatively, in your graph before creating a new Vector3 for scale, you can grab the character GameObject's current scale and then feed those values in so it keeps the scale it's at.
     
    Last edited: Apr 17, 2021
  3. Giovy79

    Giovy79

    Joined:
    Apr 16, 2021
    Posts:
    4
    OK. Thank you very much!!